Re: temporary disable thread switching using pthreads



For example, suppose thread X gets to a
safe place and suspends, but then thread Y gets into a situation where
it cannot progress until thread X does something, and it holds a
critical resource that the exclusive thread will need.

I suppose that by "hold" you mean "is in critical section", but if the
construction above (stopping all other threads) is the only way to protect
resources, this situation is impossible. Or so I think.

Of course it doesn't mean, that doing it's efficient or smart.

JD

.