From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Neil Jerram" Newsgroups: gmane.lisp.guile.user Subject: Re: multi-threading Date: Sat, 5 Jul 2008 23:34:22 +0100 Message-ID: <49dd78620807051534s3270381bs686248f7def631ea@mail.gmail.com> References: <486FF23B.6000301@pp2.inet.fi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1215297277 18168 80.91.229.12 (5 Jul 2008 22:34:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Jul 2008 22:34:37 +0000 (UTC) Cc: guile-user@gnu.org To: "=?ISO-8859-1?Q?Henri_H=E4kkinen?=" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jul 06 00:35:23 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KFGLj-0007t0-Fj for guile-user@m.gmane.org; Sun, 06 Jul 2008 00:35:23 +0200 Original-Received: from localhost ([127.0.0.1]:51210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KFGKs-0001d6-8z for guile-user@m.gmane.org; Sat, 05 Jul 2008 18:34:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KFGKo-0001cP-1Q for guile-user@gnu.org; Sat, 05 Jul 2008 18:34:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KFGKm-0001bx-SR for guile-user@gnu.org; Sat, 05 Jul 2008 18:34:25 -0400 Original-Received: from [199.232.76.173] (port=53562 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KFGKm-0001bt-LI for guile-user@gnu.org; Sat, 05 Jul 2008 18:34:24 -0400 Original-Received: from rv-out-0708.google.com ([209.85.198.245]:32707) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KFGKm-0008Ho-Al for guile-user@gnu.org; Sat, 05 Jul 2008 18:34:24 -0400 Original-Received: by rv-out-0708.google.com with SMTP id k29so2071750rvb.6 for ; Sat, 05 Jul 2008 15:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=LEYtsO/5vyjI7ZfhI/2phL1flgd+XvUCeLPLK2PPYRY=; b=wfZ6Rb137f07Q5zSUL/a13SneEsIl8XT7RFz4lei4Fbi11SoIdjDjzk10kzx+5yh82 RsThXXvvsuZTTNm+49az1BxxYiMSrdqccE0GHXPpu1TJBxSIgra5xRV95gz9FSEKG+Ar l9An/Qp/AvaJorw8U46z6l1ivlFyuQGpigyX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=lyiMl+04JjWGx01WboXf+UqHq8B+pSpYDG6N9ucPJ+ahAo9eE/NCma2XYdOe5aOE4b 8GrXkGhaqN4kHknqgKsTRE8ETsCpLKBaDQZIuiU8ZDwdPZ+2ZoSEcjGFwTHVhtSmsaqH YZVXE2STOSzZXOF6jN4uhP4i7T+WwTxMCSjeE= Original-Received: by 10.114.145.18 with SMTP id s18mr4852705wad.26.1215297262764; Sat, 05 Jul 2008 15:34:22 -0700 (PDT) Original-Received: by 10.114.197.7 with HTTP; Sat, 5 Jul 2008 15:34:22 -0700 (PDT) In-Reply-To: <486FF23B.6000301@pp2.inet.fi> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6629 Archived-At: 2008/7/5 Henri H=E4kkinen : > Hello, > > I am trying to use Guile from an multi-threaded application. Here is a > sample code: > > // test.c > > #include > #include > > static void * > inner_thread (void *p) > { > scm_c_eval_string ("(newline)"); > return NULL; > } > > static void * > thread (void *p) > { > return scm_with_guile (inner_thread, p); > } > > static void > inner_main (void *closure, int argc, char **argv) > { > pthread_t thr; > pthread_create (&thr, NULL, thread, NULL); > pthread_join (thr, NULL); > } > > int > main (int argc, char **argv) > { > scm_boot_guile (argc, argv, inner_main, NULL); > return 0; > } > > > I have read from the Guile manual that I should be able to use threads in > this way. However, I get ERROR: Stack overflow. Do you know where is the > problem? Running `guile --version` returns "Guile 1.8.1". Your program looks OK to me. There is a known stack overflow problem on some OSs, when just trying to load boot-9.scm, and when libguile is compiled without much optimization. What OS are you running on? Also, if you could manage to test the same program with the latest release (1.8.5), please do that and let us know the result. Neil