Explain this about threads
Tech-Archive recommends: Fix windows errors by optimizing your registry
"Instead of just waiting for its time slice to expire, a thread can block
each time it initiates a time-consuming activity in another thread until the
activity finishes. This is better than spinning in a polling loop waiting
for completion because it allows other threads to run sooner than they would
if the system had to rely solely on expiration of a time slice to turn its
attention to some other thread."
I don't get the "a thread can block each time...". What does it mean by
blocking? Does it mean that if thread B needs something from thread A that
thread A stops thread B from running until its finished but not interfer
with some other thread C?
Thanks,
Jon
.
Relevant Pages
- Re: Explain this about threads
... each time it initiates a time-consuming activity in another thread until the activity finishes. ... Waiting for an event from another thread in a SpinWait loop, prevents the other thread to signal the event, so basically you are wasting CPU cycles for nothing. ... Define the count as such that you spin for less than the time needed to perform a transition to the kernel and back, ... Spinning for a longer period is just a waste of CPU cycles, you better give up your quantum by calling Sleepor PInvoke the Kernel32 "SwitchToThread" API in that case. ... (microsoft.public.dotnet.languages.csharp) - Re: Explain this about threads
... each time it initiates a time-consuming activity in another thread until ... This is better than spinning in a polling loop ... Waiting for an event from another thread in a SpinWait loop, ... Spinning for a longer period is just a waste of CPU cycles, ... (microsoft.public.dotnet.languages.csharp) - Re: Does Monitor.Exit yield to waiting threads?
... > threads(including the thread that was waiting) to do some work? ... > obtaining a time slice as soon as the lock is released I was thinking ... Reducing the worker thread's priority ... Now I have one scenario where the GUI thread is very ... (microsoft.public.dotnet.general) - Re: Explain this about threads
... each time it initiates a time-consuming activity in another thread until the activity finishes. ... Does it mean that if thread B needs something from thread A that thread A stops thread B from running until its finished but not interfer with some other thread C? ... There is usually no reason to sit and spin in the meantime, so normally the remainder of B's time slice would be yielded to the scheduler in hopes that some other task has a use for the CPU resource. ... (microsoft.public.dotnet.languages.csharp) - Re: Best option for idle wait
... Once a thread gives up it's time slice it's impossible to reactivate it on ... This is how the scheduling in windows works. ... > cycles and I can't do much else while I am waiting. ... > very accurate microsecond-level timing. ... (microsoft.public.win32.programmer.kernel) |
|