efairbanks / cybin

A programming/performance environment for seamless online and offline audiovisual rendering.
28 stars 4 forks source link

Lua multithread corruption fix #17

Closed efairbanks closed 6 years ago

efairbanks commented 6 years ago

Lua was being used by the main thread and the audio thread. This seemed fine right up until blocking IO would corrupt the the Lua stack, and then everything would go to hell. Now there's a ring buffering system in the main thread that the audio thread can pull from, and blocking IO is handled by a pthread and some shared memory with a seemingly-sketchy-but-actually-safe lock system.