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,gmane.lisp.guile.devel Subject: Killing off scm_init_guile for Guile 2.0 ? Date: Thu, 15 Jan 2009 23:30:02 +0000 Message-ID: <49dd78620901151530o66a2641ax47e526d15fc09faf@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232062230 16002 80.91.229.12 (15 Jan 2009 23:30:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2009 23:30:30 +0000 (UTC) To: guile-devel , "Guile User" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jan 16 00:31:37 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 1LNbgU-00030H-VA for guile-user@m.gmane.org; Fri, 16 Jan 2009 00:31:35 +0100 Original-Received: from localhost ([127.0.0.1]:54198 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNbfD-0004zu-G6 for guile-user@m.gmane.org; Thu, 15 Jan 2009 18:30:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNbf6-0004uM-A8 for guile-user@gnu.org; Thu, 15 Jan 2009 18:30:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNbf5-0004sM-4V for guile-user@gnu.org; Thu, 15 Jan 2009 18:30:07 -0500 Original-Received: from [199.232.76.173] (port=55673 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNbf4-0004s1-TU; Thu, 15 Jan 2009 18:30:06 -0500 Original-Received: from mail-bw0-f14.google.com ([209.85.218.14]:52735) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LNbf3-0001LO-VR; Thu, 15 Jan 2009 18:30:06 -0500 Original-Received: by bwz7 with SMTP id 7so886157bwz.18 for ; Thu, 15 Jan 2009 15:30:03 -0800 (PST) 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:mime-version:content-type:content-transfer-encoding :content-disposition; bh=oQzNeq3zppF5O0XGcO09VFX7fVrv83emR7zCtjjZQr4=; b=Mx86drMpK6/2k/dw3gfxLbUhCUZOTXHHBLRjpg5BhFbXmYU6S1T28q1CxieBLZS/tz FSqOF3sA69LbGB9geXjKtKmEhlilRdInthImKYsXm9RJibGUSY5oubroaPku8kARVcJ2 2Ko7cTQa3BiIMeJMZhHyNK1ZcExHp8OhpABNQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=lA8nfmazK4Cd868itqajyzXfg5xp5leKn5RBX6fPLAvVAnN0vjzEy2mtFFpqXP99uH aVkq2ALYuBTE8bTV8HAAAc0ErVkBLESl75P9mVpqSEjKU+TRr/o5fsiOkOE1dgQjlFiA CWJsjOeKisXEvxWpcm2ZJGEEk2x4q2Ulkruss= Original-Received: by 10.181.145.6 with SMTP id x6mr608498bkn.94.1232062202994; Thu, 15 Jan 2009 15:30:02 -0800 (PST) Original-Received: by 10.181.208.17 with HTTP; Thu, 15 Jan 2009 15:30:02 -0800 (PST) Content-Disposition: inline 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:7057 gmane.lisp.guile.devel:8036 Archived-At: scm_init_guile has always been a bit problematic, as it requires lots of heuristic and OS-dependent code to try to determine where the base of the stack is. It's never been formally deprecated, but we have always advised people to use scm_boot_guile or scm_with_guile if they can, and the manual says: The function `scm_init_guile' might not be available on all platforms since it requires some stack-bounds-finding magic that might not have been ported to all platforms that Guile runs on. Thus, if you can, it is better to use `scm_with_guile' or its variation `scm_boot_guile' instead of this function. Now I've found another problem with it (while investigating Greg's NetBSD "unlocking unlocked mutex" report), so I'm wondering if it's time now (i.e. in Guile 2.0) to remove it. Can you respond to this thread if you think you would be inconvenienced by this, or are aware of a library or application that currently uses scm_init_guile ? The problem is that if a thread is initialized (for Guile) by calling scm_init_guile, Guile doesn't push a cleanup function for it. This means that if that thread is later terminated while in Guile mode, it will die holding its "heap" mutex, and sooner or later (at the next GC) that will cause all other Guile processing to hang. It isn't possible for scm_init_guile to push a cleanup function, because the pthreads API requires pthread_cleanup_push () and pthread_cleanup_pop () to be paired in the same lexical scope. Thoughts? On the other hand, does moving to BDW-GC take a lot of this out of our hands anyway? In any case, it would be interesting to hear whether people think that scm_init_guile is really needed. Regards, Neil