lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Fri, Oct 31, 2014 at 10:24 AM, Thiago L. <fakedme@gmail.com> wrote:
Let's say I have a wrapper program, that calls Lua, and most of my code is Lua. Let's say my Lua code calls C plugins, (which were developed for a different program) which may or may not be multithreaded.

The plugin does the following on a timer event: release a lock, and acquire it again. When other threads want to call my code, they try to acquire that lock, then call my code, then release it again.

What's the best way to support this? I obviously can't use the same lua thread for it (I need a separate stack and stuff), but I'm not sure how I _should_ do it.

Could you give a little more detail about where you'd like help?  You've said you've got C plugins, threads, locks, timers, and maybe multiple lua states- but which of these or what interaction between these parts specifically is a problem?