On Tue, 2010-10-26 at 16:23 -0400, raito@... wrote:
> I tried it, and it didn't work for me, but I was doing something
> somewhat unusual.
> I was trying to write a CFFI for portaudio. Portaudio on Windows uses
> CreateThread, and uses that thread for callbacks to fill the audio
> I didn't do much tracking, but calling back into your version of a
> threaded Windows SBCL from an externally created thread was pretty
> unstable. It might work a couple times, then crash. Or it might crash
> the first time.
> Sometimes, I might get to run my function a few more times by
> initializing portaudio twice before calling anything else, which is
> pretty weird behavior.
That's expected - SBCL fails when callback is executed in "foreign"
thread (SBCL thread require initialization (thread-local storage and
registration in all_threads list) which is only done for threads created
with make-thread function). I'm actually very surprised that it even