lua-users home
lua-l archive

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

It was thus said that the Great D. Matt Placek once stated:
> On Fri, Jul 12, 2013 at 11:22 PM, Andrew Starks <>wrote:
> >
> > Matt,
> >
> > In looking at the lua source, it seemed like any table access would
> > require locking (lua_lock). Also, is the stack filo?
> >
> I've avoided lua_lock  questions so far by not doing any lua operations
> except in the main thread.  Any other threads solely do systems operations
> in C, and any data structures exchanged between the threads are marshalled
> to/from lua so that I'm not accessing the lua state except in the main
> thread. The stack is lifo (which is simpler to implement lock free)- it
> doesn't matter what order the events are processed in since they are all
> independent and asynchronous anyway.

  The only issue I see with the stack is that it could lead to
starvation if the messages arrive faster than the stack can be drained.