|
I wonder if you are not describing exactly our approach.The C thread receives an anchored Lua thread. The callback function is either a function or a coroutine. It passes a message into a queue. the queue needs locks because there are many C threads. We signal the queue manager, which is a coroutine running in main's OS thread and it removes all of the messages and processes.
Someone, somewhere has to manage a mutex to a message cue. No?