From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs,gmane.comp.programming.garbage-collection.boehmgc Subject: Re: [Gc] pthreads and libgc Date: Sun, 20 Mar 2011 00:26:19 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1300577189 20520 80.91.229.12 (19 Mar 2011 23:26:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 Mar 2011 23:26:29 +0000 (UTC) Cc: bug-guile , gc@linux.hpl.hp.com To: Ivan Maidanski Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Mar 20 00:26:24 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q15XL-0006WJ-TV for guile-bugs@m.gmane.org; Sun, 20 Mar 2011 00:26:24 +0100 Original-Received: from localhost ([127.0.0.1]:35602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q15XL-0004gK-Ck for guile-bugs@m.gmane.org; Sat, 19 Mar 2011 19:26:23 -0400 Original-Received: from [140.186.70.92] (port=59325 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q15XE-0004cW-AI for bug-guile@gnu.org; Sat, 19 Mar 2011 19:26:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q15XD-0000c1-0u for bug-guile@gnu.org; Sat, 19 Mar 2011 19:26:16 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:57270 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q15XC-0000br-Ru for bug-guile@gnu.org; Sat, 19 Mar 2011 19:26:14 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id DC4FF4C98; Sat, 19 Mar 2011 19:27:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=BrV4F/9kzMXQCds6ijkWDJcDsjE=; b=glT4um t3NPLCWTNqjnk1EjrBwiqi284b9c6F/x6I0wvAxFkVvjesgWC5TlupTmVPPYFhrV DXdXkVyG2WSkV1o3NbYgCl/j3Uw5Zy9eymcmJHROhC9EKsWIuYoS90f6hcaH0Nnq s4QAtHh9AP3jT0gKxJ5RR741vvQDm/dGKJG44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=RNgp2Ia+Tpwa1UeYKc+uilKT8cZOxNu8 vo6eHdhSb1sSNVjNkOk6YVQzQFc9AN6MvI99QVDA/yNNSV8louQEHKMI5/qXlLXn WkPufYt1mYEP7JGe/C/XXYX2jwBAvyy2P38rLDyhBKYRgyTznbgTdVrWhhiJAhsz bOLX9foRzmE= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id B9F344C97; Sat, 19 Mar 2011 19:27:46 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id EC7FB4C96; Sat, 19 Mar 2011 19:27:43 -0400 (EDT) In-Reply-To: (Ivan Maidanski's message of "Sat, 19 Mar 2011 22:18:17 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 7F56884C-5280-11E0-8411-E8AB60295C12-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5347 gmane.comp.programming.garbage-collection.boehmgc:4437 Archived-At: 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/