From: Brian Candler Date: 2003-07-21T16:24:51+09:00 Subject: Re: not terminatinga process On Mon, Jul 21, 2003 at 11:32:45AM +0900, Kurt M. Dresner wrote: > I'm currently programming a chat bot. The problem is that when I run > the bot, it spawns a thread that handles the incoming messages. > However, if the main thread terminates, this spawned thread terminates > too. So right now I have a busy waiting loop in my main thread, and it > uses up all my CPU time. This is not a permanent solution. What is a > good solution to this problem (such that I can kill the processes when I > want to)? t = Thread.new do .. stuff in a thread end t.join # <<-- that's what you need Regards, Brian.