From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Maidanski Newsgroups: gmane.comp.programming.garbage-collection.boehmgc,gmane.lisp.guile.bugs Subject: =?utf-8?Q?Re[2]=3A__pthreads_and_libgc?= Date: Sun, 20 Mar 2011 13:45:12 +0300 Message-ID: References: Reply-To: Ivan Maidanski NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1300618181 25082 80.91.229.12 (20 Mar 2011 10:49:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 20 Mar 2011 10:49:41 +0000 (UTC) Cc: bug-guile , gc-V9/bV5choksm30D7ZfaTJw@public.gmane.org To: Andy Wingo Original-X-From: gc-bounces-V9/bV5choksm30D7ZfaTJw@public.gmane.org Sun Mar 20 11:49:36 2011 Return-path: Envelope-to: gcpgb-gc-Uylq5CNFT+jYtjvyW6yDsg@public.gmane.org Original-Received: from madara.hpl.hp.com ([192.6.19.124]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1GCW-0005di-0W for gcpgb-gc-Uylq5CNFT+jYtjvyW6yDsg@public.gmane.org; Sun, 20 Mar 2011 11:49:36 +0100 Original-Received: from mailhub-pa1.hpl.hp.com (mailhub-pa1.hpl.hp.com [15.25.115.25]) by madara.hpl.hp.com (8.14.4/8.14.4/HPL-PA Relay) with ESMTP id p2KAn5PF011030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 20 Mar 2011 03:49:06 -0700 Original-Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by mailhub-pa1.hpl.hp.com (8.14.3/8.14.3/HPL-PA Hub) with ESMTP id p2KAn529032571 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 20 Mar 2011 03:49:05 -0700 Original-Received: from napali.hpl.hp.com (localhost.hpl.hp.com [127.0.0.1]) by napali.hpl.hp.com (8.13.4/8.13.4/HPL-PA send-recv-int) with ESMTP id p2KAkJMg002714; Sun, 20 Mar 2011 02:46:21 -0800 Original-Received: from madara.hpl.hp.com (madara.hpl.hp.com [15.0.152.124]) by napali.hpl.hp.com (8.13.4/8.13.4/HPL-PA send-recv-int) with ESMTP id p2KAkGIo002711 for ; Sun, 20 Mar 2011 02:46:16 -0800 Original-Received: from f185.mail.ru (f185.mail.ru [217.69.128.134]) by madara.hpl.hp.com (8.14.4/8.14.4/HPL-PA Relay) with ESMTP id p2KAk3Bj010916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 20 Mar 2011 03:46:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Message-Id:Content-Transfer-Encoding:Content-Type:Reply-To:In-Reply-To:References:Date:Mime-Version:Subject:Cc:To:From; bh=jNY5bSGo3SJ7+PUx50fFnMSl9s7QTYMNPWZFnPYZ8jE=; b=Z8l6Py68oVFVPbLZqWS98ryGTb85E9YwN4LeCYz7Mu8XTjKdPoJkAzDawZo+XQIrvHDlx8TYE+pFjPB588YpU2T/qpZ73MGTvvzC2fm+d6NgaDht79X7+n+TubBY9+nN; Original-Received: from mail by f185.mail.ru with local id 1Q1G8G-0005an-00; Sun, 20 Mar 2011 13:45:12 +0300 Original-Received: from [109.225.5.181] by e.mail.ru with HTTP; Sun, 20 Mar 2011 13:45:12 +0300 X-Mailer: mPOP Web-Mail 2.19 X-Originating-IP: [109.225.5.181] In-Reply-To: X-Spam: Not detected X-Mras: Ok X-Scanned-By: MIMEDefang 2.71 on 15.0.152.124 X-Scanned-By: MIMEDefang 2.71 on 192.6.19.124 X-BeenThere: gc-V9/bV5choksm30D7ZfaTJw@public.gmane.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Garbage Collector bugs/discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: gc-bounces-V9/bV5choksm30D7ZfaTJw@public.gmane.org Errors-To: gc-bounces-V9/bV5choksm30D7ZfaTJw@public.gmane.org Xref: news.gmane.org gmane.comp.programming.garbage-collection.boehmgc:4440 gmane.lisp.guile.bugs:5352 Archived-At: Hi, I've modified GC_set_all_interior_pointer(), so it should be possible to alter all-interior-pointers mode even after GC_INIT (not quite sure this will always work as expected although). If you want to still support v6.8 then I think you should check GC_VERSION_MAJOR/MINOR and use GC_set_all_interior_pointer() if v7.2+. GC_INIT is a no-op if GC is already initialized. If you already care about threads registering then you can compile your app with -D GC_NO_THREAD_REDIRECTS (thus avoiding GC initialization in response to a pthread_create). Regards. Sun, 20 Mar 2011 00:26:19 +0100 Andy Wingo : > Hi Ivan, > > Thanks for the response. > > On Sat 19 Mar 2011 20:18, Ivan Maidanski writes: > > > GC_all_interior_pointers cannot be modified after GC_INIT according to > > the spec. GC_set_all_interior_pointers() has an assertion check for this > > condition. > > I realize this. We still allow compilation against 6.8, so I can't > blindly use GC_set_all_interior_pointers, though there are > possibilities. > > However, that's not quite the issue. > > (1) How do I detect that GC has already been initialized, by some other > module, and so avoid the GC_INIT ? > > > You could compile GC without -D ALL_INTERIOR_POINTERS. > > Unfortunately this is not possible, e.g. on Debian where we use a shared > libgc. > > > But, anyway, it is recommended to initialize GC explicitly (i.e. by > > GC_INIT), so placing GC_INIT() (together with > > GC_set_all_interior_pointer) to the beginning of your main() should be > > the best way out. > > We can add some documentation to this regard in the manual, if needed. > But is there no way to get around this, and do the right thing? For > example, to avoid implicit GC initialization in response to a > pthread_create. > > Best regards, > > Andy > -- > http://wingolog.org/ > _______________________________________________ > Gc mailing list > Gc-V9/bV5choksm30D7ZfaTJw@public.gmane.org > http://www.hpl.hp.com/hosted/linux/mail-archives/gc/