Subject: Re: pthread_{suspend,resume}_np
To: Christos Zoulas <christos@zoulas.com>
From: Stephan Uphoff <ups@stups.com>
List: tech-kern
Date: 08/10/2003 22:20:04
Christos Zoulas wrote:
> I need pthread_{suspend,resume}_np for java. I took a stab at their
> implementation, but I am missing something because sometimes I get
> an assertion failure in pthread__sched_bulk() where qhead == head of
> runq. Any ideas?

The transitions of a thread state from PT_STATE_BLOCKED_QUEUE to
state PT_STATE_RUNNABLE looks a little bit rocky.
(An example would be pthread_cond_signal())

   It does not involve a pt_statelock
	
   There is a time-window where no locks are held and
	- the thread is still in state PT_STATE_BLOCKED_QUEUE
	- the thread is already removed from the sleep queue
	- the thread is on the way to the run queue

If pthread_suspend_np is called during this time window it could screw
up the sleep,run and suspend queue.

	Stephan