Thread.stop

Is there anything that will wake up a thread that has been stopped with
Thread.stop, other than Thread#run or Thread#wakeup?

The reason I’m asking is that in my program I occasionally see a thread
that was stopped (with Thread.stop) later be awake again, and none of my
other threads have called run or wakeup on that thread. I thought I’d
ask here before trying to digest rb_thread_schedule() …

This is with ruby-1.7.3-2002.12.12

Hi,

···

In message “Thread.stop” on 03/02/26, Joel VanderWerf vjoel@PATH.Berkeley.EDU writes:

Is there anything that will wake up a thread that has been stopped with
Thread.stop, other than Thread#run or Thread#wakeup?

None from Ruby level, except for raising exception or signal from
outside. I need further information to identify the problem.

						matz.

Yukihiro Matsumoto wrote:

Hi,

Is there anything that will wake up a thread that has been stopped with
Thread.stop, other than Thread#run or Thread#wakeup?

None from Ruby level, except for raising exception or signal from
outside. I need further information to identify the problem.

Are you saying that if a thread has stopped (waiting for a lock on a
semaphore of some kind) then an exception in another thread or a signal
received by the process might wake it up?

···

In message “Thread.stop” > on 03/02/26, Joel VanderWerf vjoel@PATH.Berkeley.EDU writes:

Yukihiro Matsumoto wrote:

Hi,

Is there anything that will wake up a thread that has been stopped with
Thread.stop, other than Thread#run or Thread#wakeup?

None from Ruby level, except for raising exception or signal from
outside. I need further information to identify the problem.

No problem now. It was my mistake: I was calling Thread.wakeup (in a
critical section) followed by Thread.run (outside the critical section),
and so of course the awakened thread could go to sleep after the wakeup
and then get awakened again by the run.

···

In message “Thread.stop” > on 03/02/26, Joel VanderWerf vjoel@PATH.Berkeley.EDU writes:

Hi,

···

In message “Re: Thread.stop” on 03/02/27, Joel VanderWerf vjoel@PATH.Berkeley.EDU writes:

None from Ruby level, except for raising exception or signal from
outside. I need further information to identify the problem.

Are you saying that if a thread has stopped (waiting for a lock on a
semaphore of some kind) then an exception in another thread or a signal
received by the process might wake it up?

I’m saying that if a thread has stopped (waiting for a lock on a
semaphore of some kind) then other thread post an exception to the
thread by using Thread#raise or a signal received by the process might
wake it up.

						matz.