Boost logo

Boost :

From: Ulrich Eckhardt (doomster_at_[hidden])
Date: 2008-01-23 12:43:44


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk