I have a service that requires me to shut down and update with me in two separate cases The difficulties are coming:
-
I have some formulas that sleep in large quantities, obviously I can not wait to wake up to wake the service to wake up. I had an idea to use auto reset which was determined by some controller thread when sleep interval (only by checking every two seconds or something), and it is immediately triggered on the OnClose timeline.
-
I have a thread that calls the blocking method call (which I can not modify). How can you stop this kind of thread?
-
I'm not sure if I Your first question is correctly understood, but have you noticed using it as an alternative to
sleep
? You can wait for the object along with the timeout, so if you want to wake it first, sign the object. -
Do you "call on a blocked thread"? Or did you mean just a blocked call? Normally, there is no way to interrupt one thread without enduring it. However, if the call is a system call, may be failing the call, there are ways to return control, e.g. I / O cancellation or closure associated handle.
Comments
Post a Comment