From: Lothar Scholz Date: 2004-03-14T04:28:00+09:00 Subject: Re: How to write a blocking ruby function in c ? Hello Paul, Friday, March 12, 2004, 9:17:19 PM, you wrote: PB> I think what you want is something like this: PB> 1. See if you have data waiting; if you do read and return. Right. PB> 2. If there is no data waiting, then call rb_thread_select with your PB> file descriptor to wait on data. The problem is that the data is comming from another thread, and i don't have a file descriptor. But it seems that there is really only the chance of using a file descriptor, maybe a pipe on Linux. But "select" does not work on pipes or file descriptors. So what can i do here ? I'm very sure that writing a socket server and a client just for wake up purpose is an overkill. In the end someone must rewrite the braindead event loop model. I just found that TCL is now offering asynchronous write/read operation which gives a huge performance increase. It's always disappointing that the implementation of Ruby looks like it is the worst of the currently available main stream script language. -- Best regards, Lothar mailto:mailinglists@scriptolutions.com