[Top][All Lists]

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

Guile + pthreads + reentrancy?

From: bindej
Subject: Guile + pthreads + reentrancy?
Date: Mon, 23 Feb 2004 18:22:22 -0500

I'm trying to get Guile working in a pthreaded program.  I ran up
against the stack overflow problem, as discussed here:

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

This situtation seems obscure, but it happens in the program I'm

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

Jeff Binder

reply via email to

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