From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: Concurrency, again Date: Thu, 20 Oct 2016 03:55:20 -0400 Message-ID: References: <87wq97i78i.fsf@earlgrey.lan> <86k2dk77w6.fsf@molnjunk.nocrew.org> <9D64B8EA-DB52-413D-AE6A-264416C391F3@iotcl.com> <83int1g0s5.fsf@gnu.org> <83twckekqq.fsf@gnu.org> <874m4aic0g.fsf@tromey.com> <7D150317-7A01-464D-8352-942631A3116B@raeburn.org> <8337juxb8h.fsf@gnu.org> <31A629C9-7C3B-4B5D-A5B5-38F556C4E064@raeburn.org> <83wph6vt0f.fsf@gnu.org> <646C7DAF-F7AB-48C2-AFDF-6881D2990617@raeburn.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1476950218 20306 195.159.176.226 (20 Oct 2016 07:56:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Oct 2016 07:56:58 +0000 (UTC) Cc: Eli Zaretskii , Emacs-Devel devel To: "Herring, Davis" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 20 09:56:52 2016 Return-path: Envelope-to: ged-emacs-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 1bx8DF-00022H-V9 for ged-emacs-devel@m.gmane.org; Thu, 20 Oct 2016 09:56:30 +0200 Original-Received: from localhost ([::1]:52998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx8DI-0002CP-5l for ged-emacs-devel@m.gmane.org; Thu, 20 Oct 2016 03:56:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx8CI-0002B4-8X for emacs-devel@gnu.org; Thu, 20 Oct 2016 03:55:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bx8CE-0004Qr-9e for emacs-devel@gnu.org; Thu, 20 Oct 2016 03:55:30 -0400 Original-Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:36142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bx8CE-0004Qb-4V for emacs-devel@gnu.org; Thu, 20 Oct 2016 03:55:26 -0400 Original-Received: by mail-qk0-x22b.google.com with SMTP id o68so78047863qkf.3 for ; Thu, 20 Oct 2016 00:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raeburn-org.20150623.gappssmtp.com; s=20150623; h=subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JjvCty/e/8Nkrkl8RWsud1V4WnT8YNxY+gHOw2gtfmE=; b=b9cKrD6FXtJRcvMfOhCecsWAS4JfbOrNuh+LdqFH11sFKXvcM3p9unXQOSOVr3Q4Pd cQsJEWdQN78LbUMfdgUEm4nLJH8eliYjaGuOCfE17Ayn3wOgP5G/0l587J7b0wcoAR6j WT0XGPv7nE0SHdCV1hQmdTMmuqVUqOKZnc4qpqIOZQwjn6vWz/n3xeZ+5ZXXmTK8rXlY XQLwrF1BnLRsQofsKqLVOHZjv2bcSstSt8zg7i9QWdyxj8uYa0hojchoyUnXxB+g35wL A7hQmfs6IVu/SRZeFjcGtQ2VU4wiZvD9o8feiShtdnXMffQVhpYZnoEEji6kiGFVuCbX qBJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JjvCty/e/8Nkrkl8RWsud1V4WnT8YNxY+gHOw2gtfmE=; b=HhkkQNSI4KjlxZAyyv/KeYD0yzf6Z7nyh/mlsS10bxlvmg7KCZ5wtiUJ1mIG1Fq5V/ Ff4nPDJVK8pP4H4dCRPLts6y8/keKdyPZX79aBF8A/Jh0QuMWZW1Wwg9ZS/EX1e5PeuB 10OwWVbRp72LMNwKRlmmtBEny03I2kk8v96wfPFTHjs6Ttz1sBSBMdE80DJK0OD0KEAK Dy1ifRJti4P6WIw9bJOkNCLpPWFvfZuHeVSgZEuHz1ErYYoQdI3t/YtyvsFePQuZEuCB i4d9p5Egk+UvnZar0c9RbYYom93g+idOmN9ni85nQnbBCRo7yt+9tmemDuBnxJx/VST0 EJqw== X-Gm-Message-State: ABUngvdai/hmWc+IGuMncLOIhpCNNu9aHs9opoLs39jchq602UoatR1TWiFGPXZkxT+j1g== X-Received: by 10.55.207.209 with SMTP id v78mr11136631qkl.318.1476950122482; Thu, 20 Oct 2016 00:55:22 -0700 (PDT) Original-Received: from [192.168.23.52] (c-50-138-183-136.hsd1.ma.comcast.net. [50.138.183.136]) by smtp.gmail.com with ESMTPSA id p28sm22871067qtb.2.2016.10.20.00.55.21 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Oct 2016 00:55:21 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208532 Archived-At: > On Oct 20, 2016, at 03:12, Herring, Davis wrote: >=20 >> we do that by calling waitpid() but then the kernel discards the = child >> process=92s status info, so the "correct" thread can no longer = respond >> to the signal by making another waitpid() call to collect the status >> info. We=92d have to save the info the first time we call waitpid(). >> But doing it from within the signal handler could be tricky, because >> in that context we=92re limited to async-signal-safe functions, and >> helpful routines like malloc() and pthread_mutex_lock() aren=92t on = the >> list. >=20 > waitid() supports the WNOWAIT flag that peeks at the child information = without destroying it: = http://pubs.opengroup.org/onlinepubs/9699919799/functions/waitid.html Ah, yes, thanks! I wasn=92t aware of that one. I think the last time I = had to deal with the wait* interfaces in portable code was back before = POSIX support could be assumed=85. :-) Still, sending signals back and forth between threads so each can wait = on its own child processes (and also somehow dealing with the ones not = bound to any specific thread) seems messy compared to the waitpid daemon = thread approach of NSPR. Ken=