From: Lothar Scholz Date: 2004-03-12T15:44:34+09:00 Subject: How to write a blocking ruby function in c ? Hello, i must communicate with a c++ subsystem on windows. The subystem has a socket like interface and i want to write some kind of thread blocking: read/write calls. But of course i know that behind the scenes the thread can't block, because we have cooperative threading with setjmp/longjmp. So i think i should write the following function: VALUE read_data (VALUE self, VALUE from) { if ( ...from has no data....) rb_thread_stop(); data = .... read data from subsystem return data; } but how can i do the thread wakeup call ? The problem is that for performance reason i can't poll and i can't setup a timer to check frequently from the ruby operating system thread. I also can't use a signal, so is there any notification mechanism that works on windows ? -- Best regards, Lothar mailto:mailinglists@scriptolutions.com