[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

How to use rb_w32_main_context() with threads?

Luis Lavena

5/26/2006 3:58:00 PM

Hello, I have been looking a way to mix native threads from C extension
with ruby (in win32).

The only reference that is close to that I'm looking for is from Nobu
Nokada, back in May, 7. 2004.

signaling a ruby thread from a win32 native thread:
http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/e704d97888f090b4/1c457c8d0d249716?q=win32+thread&rnum=3#1c457c...

What I'm trying to accomplish is allow the win32/service project form
Dan Berger get the stop/resume events working correct based on
correctly implemented C code.

The limitation is that 2 native threads required to services works
(Service_Main and ServiceDispatcher) need to call back functions
defined in the class at ruby.

More important, the ServiceDispatcherCtrl need to fire these events
when the ServiceManager (windows) request a stop/pause/resume event.

Becasue these threads aren't the ones where the ruby interpreter is
running, we need some sort of context switching to allow execution of
these.

Is that possible using rb_w32_main_context(), and how? As I have said,
didn't find a sample reference to it.

Thank you for your time, please excuse my poor english.

Regards,

Luis Lavena