X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:references:from:to:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=fkQk PmYMxQpkH/h9FHL4Lusn++PzPMOSgyZM7AwyJx+QCg48k/nl9fneZeAbE1OVdnEu ZZQ28Ia/eUGjXJzeMBdnpQLONUx2LPGwK3ucXZ8wxl7NYFb3uWOAtnuKrZ/xr/F3 YV8tlhctSWyN6CzuFS9WTRx89fySVUlQtj4R+Bo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:references:from:to:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=rf8J6Err7P xAFFWAyw0idVApHyk=; b=oSexsT+TPltlYNJ32WlImCYj6cOJQ1Swjo2qogvhJi yFYuOKeLgdTuYb3us+DxlWBdayhfAlaQYL2R7N0dyOsrbkoyBsSOr6r3VhBRWzRk pNsEByLoyJWe/jJTL2bFIm04TqXUO5cGXnt8E6/edrywd9pdRCV0yr/HOxBxpLVi M= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=H*r:4.77, HX-Envelope-From:sk:michael X-HELO: atfriesa01.ssi-schaefer.com Subject: Re: [ANNOUNCEMENT] TEST: Cygwin 3.0.0-0.4 References: <1044696418 DOT 20190206033644 AT yandex DOT ru> From: Michael Haubenwallner To: cygwin AT cygwin DOT com Openpgp: preference=signencrypt Message-ID: Date: Wed, 6 Feb 2019 10:54:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <1044696418.20190206033644@yandex.ru> Content-Type: multipart/mixed; boundary="------------734BA26BF088477582B6C021" --------------734BA26BF088477582B6C021 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi Andrey, while not being involved with this change, I may provide some background though: On 2/6/19 1:36 AM, Andrey Repin wrote: > Greetings, Corinna Vinschen! > >> Changes from 3.0.0-0.3: > >> - Cygwin PIDs have been decoupled from Windows PID. Cygwin PIDs are >> now incrementally dealt in the range from 2 up to 65535, POSIX-like. > > I don't quite get it. > What's the rationale? Why not just use system PID's? To some degree, Cygwin PIDs already have been decoupled from Windows PIDs before. For example, with POSIX exec() the new process needs to have the same POSIX PID, but Cygwin does have to create a new Windows process here, so the Windows PID cannot be used as the POSIX PID within the new process. Another topic here is PID reusage: A POSIX shell is required to be able to 'wait' for at least CHILD_MAX unique immediate children processes, as described in http://pubs.opengroup.org/onlinepubs/9699919799/utilities/wait.html Cygwin does define CHILD_MAX to be 256, so immediate children should not reuse a process ID from one of the last 256 wait()ed immediate children processes. Attached is a bash script to test for when children PIDs get reused. HTH, /haubi/ --------------734BA26BF088477582B6C021 Content-Type: application/x-shellscript; name="pid-reuse-count.sh" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="pid-reuse-count.sh" IyEgL3Vzci9iaW4vZW52IGJhc2gKCmNvdW50PTAKbWluPQptYXg9CndoaWxl IHRydWUKZG8KCS9iaW4vdHJ1ZSAmCglsYXN0PSQhCglbWyAke21pbjo9JHts YXN0fX0gLWd0ICR7bGFzdH0gXV0gJiYgbWluPSR7bGFzdH0KCVtbICR7bWF4 Oj0ke2xhc3R9fSAtbHQgJHtsYXN0fSBdXSAmJiBtYXg9JHtsYXN0fQoJW1sg JHsjbGFzdH0gPiA0IF1dICYmIHVzZWQ9dXNlZF8ke2xhc3Q6OigoJHsjbGFz dH0tNCkpfSB8fCB1c2VkPXVzZWRfMAoKCWlmIFtbICR7IXVzZWR9ID09ICoi ICR7bGFzdH0gIiogXV07IHRoZW4KCQlicmVhawoJZmkKCSgoIGNvdW50Kz0x ICkpCglldmFsICIke3VzZWR9Kz0nICR7bGFzdH0gJyIKCWlmIFtbICIke2Nv dW50fSIgPT0gKjAwMCBdXTsgdGhlbgoJCWVjaG8gJHtjb3VudH0KCWZpCmRv bmUKCmVjaG8gInJldXNlZCBwaWQgJHtsYXN0fSAobWluICR7bWlufSwgbWF4 ICR7bWF4fSkgYWZ0ZXIgJHtjb3VudH0gdHJpYWxzLiIK --------------734BA26BF088477582B6C021 Content-Type: text/plain; charset=us-ascii -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple --------------734BA26BF088477582B6C021--