From: Robert Klemme Date: 2008-09-10T22:53:43+09:00 Subject: Re: Difference between "sleep()" and "Thread.stop"? 2008/9/10 Iņaki Baz Castillo : > Hi, is there any difference between doing: > > sleep > > and: > > Thread.stop > #sleep resumes automatically after a given time, #stop does not. > In both cases the current thread is in "sleep" state. > > Also, why there is no way to stop/pause/sleep a thread different of the current? > I mean something as: > > t1 = Thread.current > Thread.new { t1.sleep } <--- This doesn't exist (neither #stop or #pause) Why should it? With threads you use other mechanisms to control execution, e.g. a blocking queue, synchronizing on a mutex etc. Cheers robert -- use.inject do |as, often| as.you_can - without end