[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: hook question
- From: Glenn Maynard <glenn@...>
- Date: Wed, 11 Oct 2006 16:20:58 -0400
On Wed, Oct 11, 2006 at 10:32:45AM -0300, Roberto Ierusalimschy wrote:
> lua_sethook has no intention of being "thread safe". As already pointed
> out in this discussion, multithreading is a can of worms that opens
> the door to hell. It is quite difficult to write correct code with
> multithreading, and it is mostly impossible to argue that the code is
> correct (although, of course, it can be easy to argue that it is wrong).
>
> However, lua_sethook has a clear intention of being "signal safe". If
> it is not, we would like to correct it.
It says "can be called asynchronous". That sounds like "can be called
from a thread", and that Mike's interpretation, too. If you only mean
"from a signal", maybe that comment could be clarified.
It also seems like there should be two lua_sethooks; one for signals,
which doesn't lock, and one for threads, which does lua_lock, like other
API calls. Otherwise, this is one of the few (that I've seen) functions
which is not threadsafe when locking is enabled.
--
Glenn Maynard
- References:
- hook question, David Burgess
- Re: hook question, Lavergne Thomas
- Re: hook question, David Burgess
- Re: hook question, Mike Pall
- Re: hook question, David Jones
- Re: hook question, Mike Pall
- Re: hook question, David Jones
- Re: hook question, Mike Pall
- Re: hook question, Glenn Maynard
- Re: hook question, Roberto Ierusalimschy