How to use rb_w32_main_context() with threads?

L

Luis Lavena

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...249716?q=win32+thread&rnum=3#1c457c8d0d249716

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top