This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Linux pthreads and Guile COOP threads
- To: bug-guile@gnu.org, guile@sourceware.cygnus.com, Xavier.Leroy@inria.fr
- Subject: Linux pthreads and Guile COOP threads
- From: Mikael Djurfeldt <mdj@thalamus.nada.kth.se>
- Date: Sat, 10 Jul 1999 20:53:39 +0200
- Reply-to: Mikael Djurfeldt <djurfeldt@nada.kth.se>
For a while I've been trying to use an application running Linux
pthreads together with Guile. It didn't appear to me that it should
be any problem to run many COOP threads inside one pthreads thread.
My application occasionally crashed inside malloc, so I thought I had
some bug writing to the wrong part of memory and destroying the
internal data structures of malloc.
Now I begin to suspect that the real problem is that pthreads uses the
stack to determine the identity of the thread (through thread_self ()).
We should of course move to pure pthreads support, but until then, is
there some simple solution to this problem? Is there some way to
inform the pthreads library about the existence of custom stacks?
(I saw a local variable __pthread_nonstandard_stacks in the pthreads
library code, but this variable seems just to indicate that the
function pthread_allocate_stack has been used. Is this correct?)
Should we just give up supporting COOPS threads inside a pthread, or
is there some workaround?