guile-devel
[Top][All Lists]
Advanced

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

GUILE_PTHREAD_COMPAT


From: NIIBE Yutaka
Subject: GUILE_PTHREAD_COMPAT
Date: Mon, 10 Sep 2001 15:13:59 +0900 (JST)

Marius Vollmer wrote:
 > can someone explain why the GUILE_PTHREAD_COMPAT code is needed?

IIRC, the code was introduced for COOP thread to co-exist with
pthreads (for Debian?).  It means, Guile (with COOP) works well
even if it is linked libpthread.  Note that libpthread could be
linked indirectly on dynamic linking.

Some GNU C library functions use thread specific data, when it is
linked with libpthread (and to be thread safe).  Say, let's call the
function FUNC.  On some architectures (or implementations), that data
is allocated on thread specific stack.

When COOP is used, the stack pointer is changed to malloc-ed area.
The function FUNC will be confused when de-references stack pointer.

Hence, with GUILE_PTHREAD_COMPAT, Guile uses the stack of the pthread
for COOP, which is a kind of kludge.  You see, we have a kernel thread
per a user thread, just for this purpose.

IMNSHO, it's somewhat ugly hack with little benefit.
-- 



reply via email to

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