From: 7stud -- Date: 2007-10-04T06:57:54+09:00 Subject: Re: Non-blocking 'gets' ? Stephen Ware wrote: > > Is there a way to perform a non-blocking gets or getc? As in a method > that reads a character from stdin if there is one in the buffer or > returns nil otherwise? I'm writing a multi-threaded application that > communicates over the internet using sockets, but I want the person who > runs the script on the host machine to be able to enter commands via > stdin. The 'gets' command hangs all my threads until it returns. > It doesn't sound like you are writing a multi-threaded application if gets hangs all your threads. The whole point of threads is to execute other blocks of code while there is idle time in a given block of code. -- Posted via http://www.ruby-forum.com/.