[uWSGI] Threads in lua ?

Roberto De Ioris roberto at unbit.it
Fri Apr 25 07:32:29 CEST 2014


> Hello,
>
> I am not sure to understand : Lua is not multithreaded but uses
> coroutines.
> I would not rely on libraries to provide the parallel tasking (lanes,
> llthread and so on) because of internal policies.
>
> Yes, dumb but..
>
> Will uwsgi help us in this field for lua ?
>
> I thought about a rpc thing with sqlite to save the evolution but it is
> not that interesting the end, because when the functions will not finish
> at the same time you have to sleep for an arbitrary time and it is not a
> reliable strategy (what if I sleep for one second and the process finished
> 100 ms after the sleep ? 900 ms lost.)
>
> I would like to spawn functions and get the whole result in the end.
>
> Thanks
>
>
>  		 	   		  _______________________________________________
>

uWSGI will generate a lua_state for every thread (if run in multithreaded
mode). So yes, with uWSGI you can have multiple threads running the same
lua app (without shared state)... and thanks to caches, queues  and locks
(and rpc to some extent) uWSGI apis you can have shared states at various
levels.


-- 
Roberto De Ioris
http://unbit.it


More information about the uWSGI mailing list