The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
[Originally posted by silona]

I am getting dramatically different results in my perfmon application. I'm
also not quite sure as to why 10 threads would cause upwards of half a million
context switches? In your picture 1.4 you only have around the 40's? Did you
change the scale on perfmon?

import-bot (20211) [Avatar] Offline
Re: p20 example 1.15
[Originally posted by alan]


Yes, I adjusted the scale. If you look at the picture on the right side
you'll see a field name Maximum. Notice it reads 448810.234. The reason
there are so many switches is that each thread loops calling Thread.Sleep(0).
This causes the thread to release the remainder of the timeslice.