Re: temporary disable thread switching using pthreads



=?ISO-8859-1?Q?Marcel_M=FCller?= <news.5.maazl@xxxxxxxxxxxxxxx> writes:

There is no problem with SMP:

"DosEnterCritSec causes other threads in the process to block themselves
and give up their time slice [...] until the corresponding
DosExitCritSec is completed."

Really? What happens when any other thread holds a library lock
when it is stopped?

However, since there is no way to suspend a thread using pthreads, I
cannot implement it this way.

Nope, and there are good reasons why suspending threads isn't possible.

Unfortunately it is not always that obvious what kind of data is
protected by a critical section which is not directly related to any
data. I think I have to do some more redesign. :-/

If it's just data to be protected, a lock would suffice.

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
.


Quantcast