[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GUILE_PTHREAD_COMPAT
From: |
Marius Vollmer |
Subject: |
Re: GUILE_PTHREAD_COMPAT |
Date: |
10 Sep 2001 21:19:51 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102 |
NIIBE Yutaka <address@hidden> writes:
> 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.
Aha, I see! Thanks. To put it into my own words: on some pthread
implementations, thread-specific data is found by looking at the stack
pointer. This doesn't work, however, when COOP tweaks the stack
pointer as well. Right?
> IMNSHO, it's somewhat ugly hack with little benefit.
Hmm, the benefit being that Guile runs in a pthread environment. Is
that a small benefit? I don't think so.