From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fredrik Tolf Newsgroups: gmane.lisp.guile.user Subject: Guile and ucontext Date: Thu, 14 May 2009 04:09:46 +0200 Message-ID: <1242266987.6770.5.camel@pc7.dolda2000.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1242267029 16215 80.91.229.12 (14 May 2009 02:10:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 May 2009 02:10:29 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu May 14 04:10:19 2009 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 1M4QOo-0005ZZ-IZ for guile-user@m.gmane.org; Thu, 14 May 2009 04:10:18 +0200 Original-Received: from localhost ([127.0.0.1]:51176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4QOn-0006jV-RB for guile-user@m.gmane.org; Wed, 13 May 2009 22:10:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M4QOY-0006i7-0f for guile-user@gnu.org; Wed, 13 May 2009 22:10:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M4QOT-0006gG-Db for guile-user@gnu.org; Wed, 13 May 2009 22:10:01 -0400 Original-Received: from [199.232.76.173] (port=47545 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4QOT-0006gD-5r for guile-user@gnu.org; Wed, 13 May 2009 22:09:57 -0400 Original-Received: from 1-1-3-7a.rny.sth.bostream.se ([82.182.133.20]:58356 helo=nerv.dolda2000.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M4QOS-0002fe-C4 for guile-user@gnu.org; Wed, 13 May 2009 22:09:56 -0400 Original-Received: from [IPv6:2002:52b6:8514:200:21d:7dff:fea1:197] ([IPv6:2002:52b6:8514:200:21d:7dff:fea1:197]) (authenticated bits=0) by nerv.dolda2000.com (8.14.3/8.14.3/Debian-5) with ESMTP id n4E29llK021827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 14 May 2009 04:09:48 +0200 X-Mailer: Evolution 2.24.5 X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (nerv.dolda2000.com [IPv6:2002:52b6:8514:200::1]); Thu, 14 May 2009 04:09:48 +0200 (CEST) X-detected-operating-system: by monty-python.gnu.org: GNU/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:7297 Archived-At: Hi list, I'd really like to use Guile in a program I'm writing, but I'm having a problem in that I'm using the ucontext calls rather heavily to run a great amount of light-weight threads (in only one pthread, that is), and it seems that Guile doesn't exactly thrive in that environment. >>From what I can tell from Guile's threads.c, Guile will just record the top and bottom of a single stack per pthread, and since I'm switching stack pointer between the original stack at the top of the process to heap-allocated stacks, it would try to mark data words from almost the entire process space when GC'ing. Is this correct, or is it perhaps possible to make Guile understand my stack switching as it is? Or is it, perhaps, possible to turn off marking of words on the stack? (I won't be keeping very many SCM pointers there that aren't reachable from scheme variables anyway, and if I do, I think I can protect them manually) If it isn't, I guess I'll have to patch Guile to cope with multiple stacks, but I'd rather spare myself that work unless it's necessary. Thanks for reading! Fredrik Tolf