lua-users home
lua-l archive

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


2014-01-27 Dirk Zoller <duz@sol-3.de>:

> Think of a spreadsheet where in some cells the user can run a script to
> process data. A lua_State is created per line. People build larger setups
> than the developer anticipated. Typically, each script terminates within
> micros. Yet there are many and they are called frequently.
>
> It runs on a 16 cpu server. It runs well, load is nicely balanced. Problems
> are spurious lockups or crashes. I want to simplify it. It has grown to
> complex.
>
> Now if I redesign it to use fewer lua_States that would be nicer. But I'd
> rather not then see performance hickups come in and learn that the original
> design was actually better.

A lua_State is simply a thread, and if you are only accessing it via
the coroutine
library it is idiomatic Lua (=nice) even if you have a huge table of coroutines.

If it ain't broke, don't fix it.