From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Cygwin port of Guile 2.2 Date: Wed, 03 May 2017 11:24:30 +0200 Message-ID: <87lgqes375.fsf@pobox.com> References: <874ly49l54.fsf@joshua.spikycactus.dnsalias.com> <87lgr38jzd.fsf@pobox.com> <87pogft8c2.fsf@priss.frightenedpiglet.com> <878tmz7945.fsf@pobox.com> <87ziffcbwg.fsf@priss.frightenedpiglet.com> <87ziew4836.fsf@priss.frightenedpiglet.com> <8760hjt5k0.fsf@pobox.com> <87r306d3vx.fsf@priss.frightenedpiglet.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1493803503 18295 195.159.176.226 (3 May 2017 09:25:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 3 May 2017 09:25:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: guile-devel@gnu.org To: Derek Upham Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed May 03 11:24:57 2017 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5qWk-0004YA-1R for guile-devel@m.gmane.org; Wed, 03 May 2017 11:24:54 +0200 Original-Received: from localhost ([::1]:35485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5qWp-0001Eq-RM for guile-devel@m.gmane.org; Wed, 03 May 2017 05:24:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5qWe-0001EW-Dv for guile-devel@gnu.org; Wed, 03 May 2017 05:24:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5qWY-00055O-FS for guile-devel@gnu.org; Wed, 03 May 2017 05:24:48 -0400 Original-Received: from pb-sasl2.pobox.com ([64.147.108.67]:52700 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d5qWY-000559-82 for guile-devel@gnu.org; Wed, 03 May 2017 05:24:42 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id EF58A6E9E0; Wed, 3 May 2017 05:24:39 -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:content-transfer-encoding; s=sasl; bh=siiuPZGaHFbl m5fob2snYdDaJkw=; b=AG2V07Uch4GXIIjGvFj85Zm7+sAZUAoY3i0++TCIPH5Y Ju81yAsd5fJbeayYIxvoUfLKJfk9EErOjubOpKUKGGpsjyb1aRkuwsQkogICYk5v ChdEbO7MZ5vU6BL09CH39xSEAXzSuoFvPOAw4HLOzdt1mcI0AoNLF4iXlp0f8LQ= 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:content-transfer-encoding; q=dns; s=sasl; b=OBf45k qExhcWjb1iUH7vos2dWDvgzRmOrLrS0ws6k52iKcdePPL4xZoGFviAi9fuP6Frhf 13Ctj5IxI4qeMAoNzx/PZlaGjMZFKRjp/qWOjjWv5FJwwJV49JiKaBsoT+dA+fE1 G/n0MLBRcZ9xBmCjs5e1AoSRGsALO/AmYFh2U= Original-Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id E87016E9DF; Wed, 3 May 2017 05:24:39 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id CEADA6E9DE; Wed, 3 May 2017 05:24:38 -0400 (EDT) In-Reply-To: <87r306d3vx.fsf@priss.frightenedpiglet.com> (Derek Upham's message of "Tue, 02 May 2017 20:18:42 -0700") X-Pobox-Relay-ID: 54E30CC0-2FE2-11E7-A58D-571C92A0D1B0-02397024!pb-sasl2.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.67 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19126 Archived-At: On Wed 03 May 2017 05:18, Derek Upham writes: > Andy Wingo writes: > >> On Mon 01 May 2017 22:48, Derek Upham writes: >> >>> Running pthread_join() on a thread only guarantees that the thread has >>> returned an exit value. >> >> Would you mind providing a reference please? It is not that I don't >> believe you but I think it's important to know whether this is a bug in >> Guile or in the pthreads implementation. > > It=E2=80=99s not explicit, but it=E2=80=99s heavily implied by the pthrea= d_exit(3) man > page: A specific implementation's man page is interesting but not the specification. The specification is "The Open Group Base Specifications Issue 7 IEEE Std 1003.1-2008, 2016 Edition" and can be found here: http://pubs.opengroup.org/onlinepubs/9699919799/ Note that pthread_exit() is not the normal way for a Guile thread to exit. I thought we removed uses of this but I see that there are a couple more that need to be removed. Are you using it? It's certainly not one that we suggest. We don't use pthread_cleanup_push either -- the lifetime of the thread from Guile's POV isn't limited to a dynamic extent of scm_with_guile, as the thread could be created by the user, as https://lists.gnu.org/archive/html/guile-devel/2011-04/msg00133.html Anyway, I digress. After looking at the specification of pthread_join (http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_join.htm= l), things do not seem clear to me. Does the thread "terminate" before or after the pthread_key destructors run? Given that: * pthread_key destructors must run in the thread AFAIU; to be able to call pthread_setspecific in a destructor you need a fresh or from a fresh new thread, and spawning a new thread to run cleanup seems unlikely * pthread_key destructors can call any function I think there's an argument that a thread doesn't "terminate" until its thread-local key destructors have finished running, and therefore pthread_join doesn't return until after the key destructors have run. This is my understanding of what happens from reading NPTL. Do I understand correctly that you are on Cygwin? Could it be a cygwin pthreads incompatibility? Andy