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: Fri, 12 May 2017 07:13:06 -0700 Message-ID: <878tm26u4t.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> <87r306d3vx.fsf@priss.frightenedpiglet.com> <87lgqes375.fsf@pobox.com> <87efw681hv.fsf@priss.frightenedpiglet.com> <87shkdrgpz.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 1494598475 6372 195.159.176.226 (12 May 2017 14:14:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 May 2017 14:14:35 +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 Fri May 12 16:14:27 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 1d9BKs-0001Qp-J9 for guile-devel@m.gmane.org; Fri, 12 May 2017 16:14:26 +0200 Original-Received: from localhost ([::1]:53971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9BKy-0004Jn-5d for guile-devel@m.gmane.org; Fri, 12 May 2017 10:14:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9BK8-0003qX-Gu for guile-devel@gnu.org; Fri, 12 May 2017 10:13:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9BK0-0006Wz-VW for guile-devel@gnu.org; Fri, 12 May 2017 10:13:36 -0400 Original-Received: from smtp61.avvanta.com ([206.124.128.61]:39630 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 1d9BK0-0006UC-Ln for guile-devel@gnu.org; Fri, 12 May 2017 10:13:32 -0400 Original-Received: from mail.avvanta.com (localhost.rowlf.p [127.0.0.1]) by mail.avvanta.com (Postfix) with ESMTP id 90A9793C43; Fri, 12 May 2017 07:13:27 -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 721BB93C2E; Fri, 12 May 2017 07:13:27 -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 1d9BJa-0002jS-RC; Fri, 12 May 2017 07:13:06 -0700 In-reply-to: <87shkdrgpz.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:19137 Archived-At: Andy Wingo writes: > scm_join_thread isn't actually implemented in terms of > scm_i_pthread_join any more. Probably that's what's going wrong here -= - > and probably that should be fixed to ensure that we actually join the > thread. (Otherwise it would be a memory leak too AFAIU.) Bcc'ing > bug-guile to create a bug for that. I noticed that scm_join_thread was calling back into Scheme-land. Are th= ese statements all correct? - We are using call-with-new-thread underneath the hood. - call-with-new-thread is documented to return a Scheme object from a thu= nk/handler. Any underlying pthreads should be implementation details. - The spawned thread sends the Scheme object to the condition variable as= soon as the user thunk exits. Any number of operations can happen after= wards; the thread is still running in Scheme-land at this point, in call-= with-new-thread=E2=80=99s wrapping thunk. - join-thread waits on the condition variable only. So at the end of join-thread we need to add a call to scm_i_pthread_join = (which we implement in threads.c) to ensure that the pthread is completel= y gone before that join-thread returns. Is that accurate? We can also u= pdate stop_finalization_thread to use the new scm_i_pthread_join. Unfortunately, I think the GC threads are going to end up being immovable= objects in the path to full process-form support. Derek --=20 Derek Upham sand@blarg.net