On Sun, Jan 11, 2009 at 7:28 PM, Faré <fahree@...> wrote:
> 1- Why does get-mutex have a with-interrupts? as the FIXME note above
> says, it's probably wrong. Nikodemus, can you comment?
It is problematic only on lutex platforms (which is to say no problems
If it did not have it, waits on lutexes could not be interrupted,
which would make all sorts of lock-related problems harder to debug
(can't interrupt a waiting thread to backtrace it, etc.)
The reason it is problematic is if an interrupt occurs and unwinds
from %LUTEX-LOCK call *after* the underlying lock has been acquired --
in which case MUTEX-VALUE doesn't get updated correctly. (There may be
other ways for an interrupt to mess up %LUTEX-LOCK, but that's the
None of this is an issue when futexes are used: FUTEX-WAIT has a
WITH-INTERRUPTS as well, but because it doesn't actually grab the lock
unwinding from there is not a problem, etc.
> 2- Because of it, I think with-active-processes-lock should NOT
> :allow-with-interrupts t least a subtle race condition occurs. Cyrus,
> does that fix your issues?
Aside from the aforementioned MUTEX-VALUE bogosity I don't see a race
there, but neither do I see why it would /need/
:ALLOW-WITH-INTERRUPTS: at a glance none of the places where it is
used seem like the indefinite waits would be expected.