[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: what core things might be in Lua 5.2
- From: gary ng <garyng2000@...>
- Date: Sat, 10 Nov 2007 23:45:45 -0800 (PST)
I was not talking about simple leaking module though
but probably how it was used.
Let's assume that the mysql module is leaky(not in the
binding but in the mysql library), in a standard
multi-thread environment, it is not a problem because
there usually is no 'unload' involved(in the child
task anyway).
rings(and luatask/lualane) on the other hand allows me
to 'require' in the child task which for some unknown
reason just cannot properly clean up(I briefly trace
the code of rings and luasql and didn't find specific
issue that cause this).
If what can be done in lanes or rings or luatask is
limited to pure lua, their usefulness would be pretty
limited as often times, the reason to use real OS
thread is for these 'external' possibly blocking
operations that usually involves third party C
bindings. As otherwise, coroutine would be a much
simpler solution.
--- Asko Kauppi <askok@dnainternet.net> wrote:
>
> Lanes locks around calls to 'require' so that only
> one can be done at
> a time. This is essentially all support a
> multithreading library can
> give to a module, I think.
>
> Using a leaking module would anyways be on the
> responsibility of the
> module author and/or user, but if there's something
> Lanes could do
> about this, please suggest. We can recycle states
> but I wouldn't
> start relying on such behaviour. In fact, I think
> Lanes suits and was
> designed for other kind of applications than
> daemons. They often have
> a limited scope of what they're doing (compared to,
> say, a GUI
> application) and would do better with a cache table
> of preset states.
> Lanes is for usage where one would not like to touch
> anything on the
> C side.
>
> -asko
>
>
> gary ng kirjoitti 11.11.2007 kello 9:11:
>
> >
> > ...
> > Another issue which I don't see people mentioning
> is
> > how to properly clean up these lua states. My
> > experience with 'rings' is that for certain third
> > party modules(say the luasql.mysql binding), it is
> > impossible to properly clean up a lua state(memory
> > leaks). So both lua lane and luatask if used in
> the
> > erlang manner(repetitively create and destroy
> states
> > like function calls), would have issues for
> writing
> > daemon process.
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com