From: Daniel Berger Date: 2008-01-25T06:11:51+09:00 Subject: Re: Using a DLL that wants a function pointer On Jan 24, 1:52 pm, "daniel åkerud" wrote: > I think this is important in this context: The callback is called from > another thread, i.e. the DLL creates a thread that reads data in the > background, and when data arrives it calls the callback. Would this be a > problem if the Ruby extension calls the Proc object from another thread, and > if so, how to solve it... At the moment, you don't. Windows callbacks occur in their own native thread. The Ruby interpreter isn't thread safe. You'll get one callback call to work, but after that it will probably segfault. Heesob is working on this for the C side of the house to see if he can come up with a way to make it work. In the meantime, I'm going to see if I can get win32-api ported to JRuby using JNA this weekend. That *should* work, though it means you'll have to use JRuby to use it, which may not be such a bad thing. :) Regards, Dan