On Wed, Apr 13, 2011 at 11:22 PM, Alexander Gladysh <aglad...@gmail.com> wrote: >> https://gist.github.com/918768 > >> This uses Robert's threading library and 0MQ binding, so will also >> work with LuaJIT. Farm blocking stuff to the helper threads that send >> messages to the application when they have stuff for the app to do. >> The application checks its inbox whenever it is idle. > > I will consider this carefully. > > One extra thread per fork upsets me deeply (maybe it should not).
They should spend most of the time blocked, so the only issue is the size of their stack. It should be trivial to add an option to llthreads to set a much smaller stack size (I think a single 4K page would be enough for the typical helper thread). If you standardize on a 0MQ socket for communication you can use threads for anything not supported by libev (or libevent), and have your event handlers send 0MQ messages too. The inproc socket performs very well: http://lua-users.org/lists/lua-l/2011-04/msg00393.html > Do not read this as critique, but I think that it is a sign that I > should not use WSAPI anymore (my problem, not WSAPI problem). Sadly I > have too much legacy code to afford a switch now, so I guess I have to > find some compromise for a while... I guess this will depend on the rest of your stack. > Alexander. > -- Fabio Mascarenhas _______________________________________________ Kepler-Project mailing list Kepler-Project@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project http://www.keplerproject.org/