This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Linux pthreads and Guile COOP threads


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?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]