[Win32utils-devel] win32-api callback causes ruby to application error (crash).

Daniel Berger djberg96 at gmail.com
Sun Jan 6 08:41:02 EST 2008


nao16t at gmail.com wrote:
> Dan-san,
> Thank you for finding out my careless mistake.
> Now the callback turned to be invoked.
> But still Ruby interpreter crashes inside the callback.
> Basically does the win32 callback run under the ruby main thread ?
> Isn't the win32 callback called by creating a new ruby thread ?

It runs in Ruby's main thread. Perhaps we should execute callbacks in 
their own Ruby thread. Does anyone else have any thoughts on this? It 
seems like a reasonable idea on the surface, but I may be missing deeper 

> If I call ruby "sleep()" at the bottom of code, the win32 callback is
> blocked until the ruby sleep returns.
> If I call win32 "Sleep()" at the bottom of code, ruby interpreter
> crushes inside the callback.
> How should the ruby mainthread wait for the asynchronous win32
> callback ?
> I tried several work-arounds, but so far no luck.
> I commented out the lines what I did in the following code.

I'm on a business trip this week so I won't have much time to play with 
it until next week I'm afraid. Perhaps someone else on the list can give 
this a try and see what the issue is.



More information about the win32utils-devel mailing list