[Top][All Lists]

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

Re: Guile + pthreads + reentrancy?

From: Mikael Djurfeldt
Subject: Re: Guile + pthreads + reentrancy?
Date: Wed, 03 Mar 2004 11:24:27 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

address@hidden writes:

> Mikael Djurfeldt writes:
>  > Each thread which has been spawned by scm_spawn_thread, that is.
>  > 
>  > scm_spawn_thread calls pthread_create and sets up Guile things.  If,
>  > for some reason, you need to create the pthread yourself and want to
>  > later make it able to use Guile, that could be arranged.  Please tell
>  > me and I'll add this to the API (this is on the TODO list).
>  > 
>  > M
> I'm now converting my code to use scm_spawn_thread instead of
> pthread_create.  This is not a problem, but there doesn't seem to be
> any public interface to get a scm_t_thread out of the SCM object.

You're right that there isn't currently any public interface for
getting the scm_t_thread value out of the SCM object.

> This is a serious problem because even functions such as
> scm_thread_join take scm_t_thread arguments, and are thus unusable
> outside of Guile.
> What should I do about this?

Would it be difficult to use scm_thread_self ()?

We should probably add a selector for this, though.  I'll try to add
it to CVS HEAD today.  (Do you need it in 1.6?)

BTW, while the "old" parts of the thread API are pretty stable, the
new parts added in HEAD are still under development, so while there
probably won't be any major changes, some things *will* change.


reply via email to

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