From: hemant Date: 2007-09-21T02:02:03+09:00 Subject: Re: Do C Extensions Block Ruby? On 9/20/07, Ilmari Heikkinen wrote: > On 9/20/07, Wayne E. Seguin wrote: > > On Sep 19, 2007, at 17:15 , Joel VanderWerf wrote: > > > ...except when you call back into ruby from your C code (right?). > > > Then the thread scheduler could get a chance to do its thing. > > Joel, > > > > Thank you for the response. > > > > How do you call back? Is that the rb_thread_schedule() method? > > Or rb_funcall(). Basically any call that executes ruby code. > rb_funcall() is slow as shit, avoid it if you can. > Ran into an "interesting" bug with a C extension once with > this: I used a global scratchpad on the C side and did ruby calls > from C to log stuff. Which let other ruby threads hit the C side and > screw up the scratchpad. Resulting in some messed up images. > > -- Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org