2fd Subj : Re: Answer David Schwartz 's question To : comp.programming.threads From : David Hopwood Date : Tue Apr 05 2005 05:29 pm Oliver Battenfeld wrote: > David Schwartz wrote: > >>>Can't main thread do anything after STOP other threads? >> >> Nope. Suppose another thread was in the middle of 'malloc' when you >>stopped it. > > Question then: What happens, if one such thread is preempted "in the middle > of malloc" by the main thread? If the main thread needs the malloc lock, it blocks at that point, and the thread that holds the lock eventually gets rescheduled and releases it. (The reply by David Schwartz misunderstood what you meant by "preempt", I think.) -- David Hopwood . 0