Reputation: 183
I have a simple question about multithreading.
I want a thread in the application to finish its task before it switches to thead from the same application?
I know it will switch with other threads from other applications. However, is it possible for thread to keep control and not switch with others threads originating from the same application?
Upvotes: 0
Views: 491
Reputation: 127543
The only way to do it is you block the other threads till the thread you want to finish unblocks them, use synchronization mechanisms like ManualResetEventSlim
, AutoResetEvent
, or SemaphoreSlim
to control the flow of your threads.
Upvotes: 2