[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warning: Unstable POSIX threads support comitted to CVS
From: |
Mikael Djurfeldt |
Subject: |
Re: Warning: Unstable POSIX threads support comitted to CVS |
Date: |
Wed, 11 Dec 2002 08:21:17 +0100 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu) |
Mikael Djurfeldt <address@hidden> writes:
> (par-fib 100 5) crashes for me... :)
It no longer does. In fact, I can't make the POSIX threads support to
crash anylonger with my basic test programs. :-)
The cause of the (par-fib 100 5) problem was interesting:
SCM
scm_make_root (SCM parent)
{
SCM root;
scm_root_state *root_state;
root_state = (scm_root_state *) scm_gc_malloc (sizeof (scm_root_state),
"root state");
if (SCM_ROOTP (parent))
{
memcpy (root_state, SCM_ROOT_STATE (parent), sizeof (scm_root_state));
[scm_copy_fluids mutates root_state with the new fluids:]
scm_copy_fluids (root_state);
root_state->parent = parent;
}
else
...
...
[The following entry to a critical section is a point where GC can happen.
Note how the new fluids are unprotected!]
SCM_REDEFER_INTS;
SCM_NEWSMOB (root, scm_tc16_root, root_state);
root_state->handle = root;
SCM_REALLOW_INTS;
return root;
}
Actually, in this case, we no longer need a critical section.
Currently, GC can only happen:
1. When we allocate cells.
2. When we perform any operation which has the potential to block the
process (like locking a mutex using scm_mutex_lock or doing I/O or
entering a critical section.
Mikael D.