lua-users home
lua-l archive

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

On 31 August 2016 at 20:14, Chris Jones <> wrote:
> Hey
> Depending on your target platform, and since you can only ever have one
> thread executing Lua at a time, it may be easier to dispatch the work to
> happen on the main thread. We do this in Hammerspoon (OS X) using Apple's
> SDK (things like dispatch_sync(), dispatch_async() and [NSObject
> performSelectorOnMainThread]).
> (For the sake of safety, we also perform a sanity check almost every time a
> C function is about to do some Lua work, to make sure it's happening on the
> main thread)

(please bottom post on this list).

You might be interested in this post of mine:

Gives you freedom from libdispatch's built in loop :)