From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bindej@rpi.edu Newsgroups: gmane.lisp.guile.user Subject: Guile + pthreads + reentrancy? Date: Mon, 23 Feb 2004 18:22:22 -0500 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <16442.35630.790674.12804@gargle.gargle.HOWL> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1077578911 11069 80.91.224.253 (23 Feb 2004 23:28:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2004 23:28:31 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Feb 24 00:28:13 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvPUj-0002MT-00 for ; Tue, 24 Feb 2004 00:28:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AvPUk-0004qn-67 for guile-user@m.gmane.org; Mon, 23 Feb 2004 18:28:14 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AvPSe-0003fh-1i for guile-user@gnu.org; Mon, 23 Feb 2004 18:26:04 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AvPS5-0003IH-QL for guile-user@gnu.org; Mon, 23 Feb 2004 18:26:01 -0500 Original-Received: from [128.113.2.2] (helo=smtp2.server.rpi.edu) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1AvPPE-0001ox-VY for guile-user@gnu.org; Mon, 23 Feb 2004 18:22:33 -0500 Original-Received: from localhost (porgyon-18.dynamic.rpi.edu [128.113.193.107]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i1NNMMnH028200 for ; Mon, 23 Feb 2004 18:22:26 -0500 Original-To: guile-user@gnu.org X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: CanIt (www . canit . ca) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2833 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2833 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? Jeff Binder _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user