From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1E16446970F for ; Sat, 30 Nov 2019 10:48:55 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id 21so2588090ljr.0 for ; Fri, 29 Nov 2019 23:48:55 -0800 (PST) Date: Sat, 30 Nov 2019 10:48:52 +0300 From: Cyrill Gorcunov Message-ID: <20191130074852.GQ19879@uranus> References: <20191129055939.GH15149@atlas> <20191129094059.GA19879@uranus> <20191129111903.GA7760@atlas> <20191129113659.GE19879@uranus> <20191129145028.GA18043@atlas> <20191129151410.GJ19879@uranus> <20191129183144.GB16921@atlas> <20191129191708.GN19879@uranus> <20191129223650.GO19879@uranus> <20191130042158.GC31199@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191130042158.GC31199@atlas> Subject: Re: [Tarantool-patches] [PATCH 1/5] popen: Introduce a backend engine List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konstantin Osipov Cc: tml On Sat, Nov 30, 2019 at 07:21:58AM +0300, Konstantin Osipov wrote: > First of all, thanks for the explanation - now I understand the > problem at least. > > > pid = vfork(); > > if (pid == 0) { > > _exit(1); > > > > here sigchld already delivered to the libev > > and it reaped it, vanishing from the system > > so that anyother application can reuse it > > No, this is not how it works. Yes, the signal itself *may* > be delivered asynchronously (*sometimes*), but the callback is called > synchronously. In other words, when you do a vfork() > and check the non-zero pid return value you're executing an > existing libev callback. No other callback will get invoked until > you finish with your callback. You know, I think I need to read more libev source code first to be able to comment. I'll back later. Kostya, thanks a huge about all your participation, I really appreciate!