From: Mikael Djurfeldt <mdj@mit.edu>
Cc: guile-user@gnu.org, djurfeldt@nada.kth.se
Subject: Re: Guile + pthreads + reentrancy?
Date: Tue, 24 Feb 2004 10:02:56 -0500 [thread overview]
Message-ID: <xy7llmscyfz.fsf@chunk.mit.edu> (raw)
In-Reply-To: <16442.35630.790674.12804@gargle.gargle.HOWL> (bindej@rpi.edu's message of "Mon, 23 Feb 2004 18:22:22 -0500")
bindej@rpi.edu writes:
> I'm trying to get Guile working in a pthreaded program. I ran up
> against the stack overflow problem, as discussed here:
>
> http://sources.redhat.com/ml/guile/1999-10/msg00114.html
> http://mail.gnu.org/archive/html/guile-user/2001-08/msg00082.html
> http://www.red-bean.com/guile/guile/old/1790.html
>
> I did the message-queueing kludge. It works, although it is messy.
> But it's not reentrant. If I tell Guile's pthread to call
> scm_eval_string, which in turn calls a gsubr, and that gsubr spawns a
> new pthread which queues a call to scm_makfrom0str, we have a
> deadlock.
>
> This situtation seems obscure, but it happens in the program I'm
> writing.
>
> The only solution I could come up with is to spawn a new Guile thread
> for each item popped off the queue, so the loop doesn't stop while a
> function is being called. But Guile threads are cooperative, and I
> can't figure out any way to have scm_yield called at the right time in
> Guile's pthread.
>
> Has anyone else succeeded at doing this? Am I missing something
> obvious?
The thread support in Guile has undergone two revisions since the
version you are using. Do you have constraints for which version of
Guile to use? Current CVS HEAD have full pthreads support, which
should make you able to remove the message queue and access Guile
directly from each thread.
M
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2004-02-24 15:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-23 23:22 Guile + pthreads + reentrancy? bindej
2004-02-24 15:02 ` Mikael Djurfeldt [this message]
2004-02-24 15:44 ` Mikael Djurfeldt
2004-02-24 22:58 ` bindej
2004-03-03 0:20 ` bindej
2004-03-03 16:24 ` Mikael Djurfeldt
2004-03-03 17:35 ` bindej
2004-03-03 16:54 ` Mikael Djurfeldt
2004-03-03 17:38 ` bindej
2004-03-20 23:02 ` Marius Vollmer
2004-02-24 21:19 ` bindej
2004-02-24 21:57 ` Mikael Djurfeldt
2004-02-24 23:07 ` Thien-Thi Nguyen
2004-02-25 3:06 ` Mikael Djurfeldt
2004-02-25 12:54 ` Thien-Thi Nguyen
2004-02-24 22:09 ` Mikael Djurfeldt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xy7llmscyfz.fsf@chunk.mit.edu \
--to=mdj@mit.edu \
--cc=djurfeldt@nada.kth.se \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).