From: Laurent Julliard Date: 2002-08-01T23:26:31+09:00 Subject: Re: "gets" blocking process not thread (in Windows only) Matt Pattison wrote: > The problem with my program is that (in Windows) gets seems to block the entire > process rather than just the current thread. This program works as expected in > linux, with the poll and process threads running continuously whilst the input > thread is waiting for user input. In windows however all threads appear to halt > as soon as the gets line is reached in the input thread, and only continue once > user input has been given. Can anyone help? > Thanks. > > Matt > > #This is my program simplified > > $input = Thread.new { > while true > command = gets.chomp > # ^^^^ > do_something command > end > } > > $poll = Thread.new { > while true > read_data_from_socket_into_queue > end > } > > $process = Thread.new { > while true > process_data_from_queue > end > } > > > . > I don't know if this relates in any way with what Curt Hibbs is trying to fix for the FreeRIDE project. We are having problems with the way threads are managed when Ruby is compiled with VC++. It sounds like the cygwin version runs ok. Which one do you use? I cc Curt because this might be an interesting test case for its fix. Laurent -- Laurent JULLIARD - Xerox R&T/SSTC/XPA - Open Source team >> Host your Xerox Software project on CodeX: http://codex.xerox.com >> Linux@Xerox community: http://xww.linux.world.xerox.com