guile-devel
[Top][All Lists]
Advanced

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

Re: Locks and threads


From: Neil Jerram
Subject: Re: Locks and threads
Date: Sun, 08 Mar 2009 22:04:19 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Linas Vepstas <address@hidden> writes:

> Perhaps I'm naive, perhaps some naming convention
> could be used to  indicate that SCM_OUT_OF_RANGE
> will never return?  None of the functions in the call stack
> gave any real hint that they might now return; they mostly
> looked liked ordinary functions.

As Andy has said, this kind of thing is quite pervasive in Guile, and
so I think it's something that developers become used to very quickly.

(Incidentally, it happens in your define-race code too.  The first
time that the program hits an undefined variable, the error (from
within scm_c_eval_string) causes a jump back out to scm_with_guile.
For the thread concerned, therefore, s->count is never incremented
anymore, and the thread just keeps hitting the same undefined variable
over and over again...)

In this code (scm_sigaction_for_thread) it would probably be better to
use the scm_dynwind_* API, and in particular
scm_dynwind_critical_section, as that would cover the mainline case
and all the error cases in one go.  But I'm surprised to see
scm_dynwind_critical_section using a fat mutex; need to look into that
a bit more...

Regards,
        Neil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]