
23 Jan
2008
23 Jan
'08
5:43 p.m.
On Wednesday 23 January 2008 04:16, 申和平 wrote:
We can create a thread very easily. While, I don’t know how to suspend and then resume it.
Just to elaborate on Frank's response, there is a reason this is not directly supported. The problem with simply suspending a thread somewhere in the middle (i.e. somehow settings its timeslice to zero) is that it might just be in the middle of malloc() with a lock around the heap held. Any other thread would then block on malloc(), possibly forever. Therefore, stop the thread in a controlled state using a condition. Uli