lua-users home
lua-l archive

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


--- Asko Kauppi <askok@dnainternet.net> wrote:
> The way Lua Lanes helps make modules multithreaded
> capable is it protects calls to 'require' so that 
> only one happens at a time. This  allows the module 
> author to do things s.a. "did we get this  
> initialized already" checks without resorting to
> critical sections.
> 
I believe we are talking about different things. What
I was talking about is the scenario of :

single process, multiple lua_State where each state
has its own 'require' of some modules(.so). And
strictly speaking it has nothing to do with the module
author or critical sections but more about how how the
.so is loaded. It seems to be some problem deeper than
that. So even each module make the proper calls to
free the .so things(as far as I can trace to for
example the luasql-mysql), there is something prevents
the lua_State from properly clean up.

This usually is not an issue for other language where
when we are talking about multi-threading, it is
usually more like sharing single VM between threads.

The net result is that if  I am not aware of this, a
few hundred/thousand(depends on memory configuration)
thread creation/termination would result in out of
memory situation.

It is just a "user beware" about this "single process,
multiple lua_State" contineous usage, not in
particular to lua lanes or rings.



       
____________________________________________________________________________________
Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz