I have a worker thread that may be active for short bursts of time and idle for rest of the time. I’m thinking to put the thread to sleep and then awake it when needed.
Any additional recommendations for this I should be aware of?
Thanks!
- this is in C#/.NET4
Just use an event to pause the worker thread: reset – paused, set – unpaused (working) state.
Here is the draft version of code that demonstrates the approach.