> A Conditionariable, IO.select (which you already knew :), > or a blocking read on any socket or pipe. > Creating a new socketpair/pipe is pretty too much imho (no matter it's a very small object, but it exists and must be handled). I thought about some kind of semaphore, then process would look like: in thread: semaphore.wait_for_event in main: semaphore.emit_event > > Create a socketpair or pipe and and write to it from the main thread. > It's also useful with the self-pipe trick[1] > > If you're stuck on a platform without UNIX sockets or pipes, you can > also connect to your main TCPServer (or another private one) to > wakeup from select. that makes the same trouble as described above: one more file descriptor, which is overhead. I knew this solution and used it in C, but I thought ruby is able to provide some better solution. -- Posted via http://www.ruby-forum.com/.