From: Roger Pack Date: 2009-07-10T22:19:33+09:00 Subject: Re: tcp server with multithreading > 1. how can I block thread until some event will occur w/o overhead? > (i.e. not timer, but something like semaphore); select [or in 1.9 fibers]. > 2. how can I interrupt IO::select() call from main thread? You'd have to have some socket within it that will interrupt. like interruptor = TCPSocket.new( '', 3333) select [interruptor], nil, nil then in other thread a TCPSocket.new('localhost', 3333) # to interrupt a.send 'a' something like that Or if you didn't care about thread safety you could use Thread.raise [scary]. But overall I might suggest eventmachine or revactor for what you want. Cheers! =r -- Posted via http://www.ruby-forum.com/.