From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Derek Upham Newsgroups: gmane.lisp.guile.devel Subject: Re: Cygwin port of Guile 2.2 Date: Tue, 02 May 2017 20:18:42 -0700 Message-ID: <87r306d3vx.fsf@priss.frightenedpiglet.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> 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 1493781562 25359 195.159.176.226 (3 May 2017 03:19:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 3 May 2017 03:19:22 +0000 (UTC) User-Agent: mu4e 0.9.17; emacs 25.1.1 Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed May 03 05:19:14 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 1d5kos-0006Mz-Do for guile-devel@m.gmane.org; Wed, 03 May 2017 05:19:14 +0200 Original-Received: from localhost ([::1]:34534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5kow-0002DT-C1 for guile-devel@m.gmane.org; Tue, 02 May 2017 23:19:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5kor-0002DC-P2 for guile-devel@gnu.org; Tue, 02 May 2017 23:19:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5koo-0004OV-Ko for guile-devel@gnu.org; Tue, 02 May 2017 23:19:13 -0400 Original-Received: from smtp61.avvanta.com ([206.124.128.61]:44821 helo=mail.avvanta.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d5koo-0004OD-DH for guile-devel@gnu.org; Tue, 02 May 2017 23:19:10 -0400 Original-Received: from mail.avvanta.com (localhost.scooter.p.blarg.net [127.0.0.1]) by mail.avvanta.com (Postfix) with ESMTP id 02BF9276D66; Tue, 2 May 2017 20:19:08 -0700 (PDT) Original-Received: from priss.frightenedpiglet.com (c-50-135-4-88.hsd1.wa.comcast.net [50.135.4.88]) by mail.avvanta.com (Postfix) with ESMTP id DEB0E276D62; Tue, 2 May 2017 20:19:07 -0700 (PDT) Original-Received: from localhost ([127.0.0.1] helo=priss.frightenedpiglet.com) by priss.frightenedpiglet.com with esmtp (Exim 4.89) (envelope-from ) id 1d5koM-0003rm-7W; Tue, 02 May 2017 20:18:42 -0700 In-reply-to: <8760hjt5k0.fsf@pobox.com> X-BlargAV-Status: No viruses detected, BlargAV v1.1 on localhost.scooter.p.blarg.net X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x [fuzzy] X-Received-From: 206.124.128.61 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:19125 Archived-At: 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: The pthread_exit() function terminates the calling thread and returns a value via retval that (if the thread is joinable) is available to another thread in the same process that calls pthread_join(3). Any clean-up handlers established by pthread_cleanup_push(3) that have not yet been popped, are popped (in the reverse of the order in which they were pushed) and executed. If the thread has any thread-specific data, then, after the clean-up handlers have been executed, the corresponding destructor functions are called, in an unspecified order. The retval becomes available to anyone joining. Then the clean-up handlers run. Then the thread-specific destructors run. I think the flaw is that Guile is using the thread-specific destructors to update global values. The thread is still effectively =E2=80=9Clive=E2= =80=9D (has visible external effects) until the destructors finish running, even though it appears to be dead if you were to ask pthreads about it. If the destructor were just freeing heap memory (for example), then no one would notice the delayed actions. Derek --=20 Derek Upham sand@blarg.net