[GD-Windows] Stopping a thread cleanly
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2002-02-17 19:37:09
|
Okay, kind of a newbie question, but I thought I understood it, now I'm not so sure. What are the advantages/disadvantages of exiting a thread based on WaitForSingleObject with short timeout vs. checking a global variable? Both are effectively in a delayed hard polling loop, where the delay is a Sleep( 250 ). The only advantage I can really see is that the WFSO call is going to avoid race conditions intrinsically, whereas checking a global variable I'll have to be a lot more diligent about guarding accesses to the variable. Brian |