[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Critical sections
From: |
Ludovic Courtès |
Subject: |
Critical sections |
Date: |
Thu, 13 Nov 2008 23:44:24 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) |
Hi,
Andy Wingo <address@hidden> writes:
> I think the idea behind the check sounds good -- it is incorrect to
> throw from within a critical section, and the check detects this.
>
> But the check is incorrect as you noticed, it should be checking if the
> current thread is in a critical section.
>
> So we have two options, to remove the check or to fix the critical
> section counter (possiblity to be thread-local). My instinct would be
> that removal is the correct solution in 1.8, and that in master the
> decision depends on whether we merge the BDW GC or not, and what the
> impact that GC has on the idea of critical sections.
Looking at uses of critical sections, it's not always clear what the
rationale is.
In some cases, e.g., `scm_sys_modify_instance ()' and
`scm_sys_modify_class ()', it's used to make an operation atomic.
In other cases, it seems to be used as a coarse-grain mutex (e.g.,
`scm_symbol_to_keyword ()', `scm_set_object_property_x ()').
So, at first sight, I'm not sure changing GCs would lead us to change
that.
Thanks,
Ludo'.