[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: rb_funcall() Ruby code callback invoked from within a native thread?

Serge Kruppa

10/4/2006 5:31:00 PM

> If you have the freedom to re-architect your application, look at the
> EventMachine library. It was designed to enable applications like yours to
> be implemented without threads.

Actually, the EventMachine library looks like a fantastic solution!

Do you think it would be wise to implement a Ruby to C RPC mechanism on top
of it? Thus instead of using native calls I would invoke an RPC stub from
Ruby that will deliver a UDP packet with the native function name and
parameters to a PThread that will in turn call the C function. Any result
from C would be passed back to Ruby using the same channel, allowing the
Ruby code to synchronize using traditional methods and avoid an utter
threading mess.