[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: stability issue (how to deal with asynchronous callbacks?)
- From: "Ashwin Hirschi" <deery@...>
- Date: Tue, 05 Apr 2005 15:16:40 +0200
The Lua/SDL_mixer integration is having the following problem:
Lua runs happily, starts to play a tune ..dam-dam..
Attaches a callback to get to the rhytm
Lua continues running..
--> sdl_mixer gives a C callback -> sdl_mixer module -> Lua call
Now, the callback probably happens in another thread, or otherwise
asynchronously to the main loop, running the Lua stack. How do we deal
A start to a solution could be organising the way "Lua continues running".
If you're able to switch your current approach to one that runs in brief steps, you're (probably) pretty much nearly there. It certainly makes the (important!) synchronising bit that David mentions fairly trivial.
Then again, I haven't looked at your sdl_mixer code. So I'm not sure how feasible switching is in your situation...
no signature is a signature.