------ art_961_27266718.1151638107770 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/29/06, Victor 'Zverok' Shepelev <vshepelev / imho.com.ua> wrote: > > Yes, It never returns. But I've thought its not a problem, because in the > code: > Thread.new{ sleep(10000) } > puts 'here' > sleep(10000) also virtually never returns, but code works as expected > (prints 'here' and exits). > <<<<<<<<<<<<<<<<<<<<< sleep(10000) is a Ruby call, not a native one. It's aware that other Ruby threads are running. Try doing the same thing on your native thread with a native API (I forget what that millisecond-sleep API is on Windows)- you'll find that it blocks your program just as the event loop did. > > >>>Hmmm... Ok, I'll try. But I think there must be more general solution > for > threading C extension. No?<<<<<<<<<<<<<<<<< > You're wandering into the strange land of native/green thread interaction. I won't be the one to start yet another rehash of this subject ;-). If you're trying to run the Windows GUI event loop, why not just use Ruby tk? ------ art_961_27266718.1151638107770--