From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.devel Subject: Re: Subprocess API. Date: Mon, 25 Sep 2017 21:34:39 +0100 Message-ID: <20170925213439.45faab44@dell.homenet> References: <87a81llos5.fsf@gmail.com> <20170923151937.5bb7d80e@bother.homenet> <874lrqlmz5.fsf@gmail.com> <20170925195939.01638900@dell.homenet> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1506397335 15638 195.159.176.226 (26 Sep 2017 03:42:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Sep 2017 03:42:15 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Sep 26 05:42:10 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 1dwgl7-0003by-9o for guile-devel@m.gmane.org; Tue, 26 Sep 2017 05:42:09 +0200 Original-Received: from localhost ([::1]:45419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwglE-0006wT-Iv for guile-devel@m.gmane.org; Mon, 25 Sep 2017 23:42:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwa5Z-0003Is-8n for guile-devel@gnu.org; Mon, 25 Sep 2017 16:34:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwa5U-0004s9-Bn for guile-devel@gnu.org; Mon, 25 Sep 2017 16:34:49 -0400 Original-Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:48393) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwa5U-0004rW-4b for guile-devel@gnu.org; Mon, 25 Sep 2017 16:34:44 -0400 Original-Received: by mail-wm0-x241.google.com with SMTP id m127so1275200wmm.3 for ; Mon, 25 Sep 2017 13:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KQfZgVN/Kc0B7FiEmlmDF6uWz46oxR/dBh31Q5MqwGw=; b=P4IR2rqB/agvYKBKHMXiCGQWfrcDymCA56qlgAnN21aygpSeoqo+j3m7Bw0pJQQtLn lxIhghHSQ2KNWjNrGPITLgZWXwu6YkUFb3OymvTT/Foq3ACOaTI6tTpl+OiRyGs+K2DU /dDwERHVxDjykECM4/F9KJ0EaPGKUTpsDoHcdepLK6Mus+q9H021+7BWmIhxg5ehpvyp gJ9l24JPsvV1OgS7TfLYDeHTCRgd6iqK6Zh7bOdT8+97E5xM4w0LhslT2/Znx1vYfG7E NWk3k1dlbjPMK/RHi39tKpG/S+3vZ/NBg4XSV9gjPU0ASPFYlaus7RuYIIqOhmy2HsNb nY8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KQfZgVN/Kc0B7FiEmlmDF6uWz46oxR/dBh31Q5MqwGw=; b=pCM2yoYZhwWXZAo4v1zdKH6kcvqCumSSBx8F513ot2m/R7UaOWoMHAliKU2xlVN85X 8xVElB1fLaJJUOVdJz8ERf0B5OJfmyFKeM7vO4OIJJwLTUetDN7jGa01BtoMfXwtvf0q BV6WdlhYeJXEKOb71DzOHWfdr73Ig4JwV9fSaCW6YYL5JlLyLxOX5Nk9OZY/QoNs6Atr rv//z6a8nkfYusViHQucNNAjZWgE56ltdx6tOuw02A6YEF3rqYjGFFFeH+q7s2CMKua7 cK5OQqk3tsNwKzgISGuaPamsW+KE0MkDXfffcNUFTxULhhIBsrDA/HFdZ3EEjgBgFKfb a6xg== X-Gm-Message-State: AHPjjUi1SafVBveCM6iJ444IAoTmbdZxQZnir/AELV5V/ju0BuV/lZqI 9k21xln3xiOW9wjTxCCVqZ18BQ== X-Google-Smtp-Source: AOwi7QCu2YWh5YO9Citb7WjI1DGlKC+pIJblAd2vqTSEfsy/mTyCFAnBxH32f6P6nPPMffuvvuxJ6Q== X-Received: by 10.28.159.6 with SMTP id i6mr1411510wme.119.1506371681281; Mon, 25 Sep 2017 13:34:41 -0700 (PDT) Original-Received: from dell.homenet (102.201.115.87.dyn.plus.net. [87.115.201.102]) by smtp.gmail.com with ESMTPSA id v9sm2963954wre.12.2017.09.25.13.34.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Sep 2017 13:34:40 -0700 (PDT) Original-Received: from dell.homenet (localhost [127.0.0.1]) by dell.homenet (Postfix) with ESMTP id 6819B442F54 for ; Mon, 25 Sep 2017 21:34:39 +0100 (BST) In-Reply-To: <20170925195939.01638900@dell.homenet> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 X-Mailman-Approved-At: Mon, 25 Sep 2017 23:42:06 -0400 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:19315 Archived-At: On Mon, 25 Sep 2017 19:59:39 +0100 Chris Vine wrote: > ... you could consider launching the new process in C code via the > guile FFI so you can ensure that no non-async-signal-safe code is > called at the wrong time; but presumably you would still have by some > means to prevent the garbage collector from being able to start a > memory reclaiming run in the new process after the fork and before the > exec, and again I do not know how you would do that. You would also > need to block system asyncs before forking (and unblock after the fork > in the original process) but that is trivial to do. On reflection I don't think there is an issue with the garbage collector if you adopted this approach. After forking there is only one thread running in the new process - the thread of execution of the forking thread - and provided that the new process does not attempt to allocate memory after the fork and before the exec, I doubt the garbage collector has a way in which it can be provoked to begin trying to reclaim memory in the new process.