delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/01/13/08:42:38

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT sourceware DOT org
Delivered-To: cygwin AT sourceware DOT org
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 906C839518B5
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=cs.umass.edu
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.umass.edu
Subject: Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6
To: Jay K <jayk123 AT hotmail DOT com>,
"cygwin AT sourceware DOT org"
<cygwin AT sourceware DOT org>
References: <MWHPR1401MB1951673B53610E3D45F15235E6529 AT MWHPR1401MB1951 DOT namprd14 DOT prod DOT outlook DOT com>
<MWHPR1401MB1951AD1FD95142752195EF0DE6529 AT MWHPR1401MB1951 DOT namprd14 DOT prod DOT outlook DOT com>
<MWHPR1401MB195104100F4D135F78351B86E6529 AT MWHPR1401MB1951 DOT namprd14 DOT prod DOT outlook DOT com>
<MWHPR1401MB195147B622BB5A90492E577AE6539 AT MWHPR1401MB1951 DOT namprd14 DOT prod DOT outlook DOT com>
From: Eliot Moss <moss AT cs DOT umass DOT edu>
Message-ID: <f8ec9d6b-23c6-ee02-4723-6e4831e22df6@cs.umass.edu>
Date: Thu, 13 Jan 2022 08:42:01 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
Thunderbird/68.12.1
MIME-Version: 1.0
In-Reply-To: <MWHPR1401MB195147B622BB5A90492E577AE6539@MWHPR1401MB1951.namprd14.prod.outlook.com>
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_NUMSUBJECT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: moss AT cs DOT umass DOT edu
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 20DDgcVp005393

On 1/13/2022 1:40 AM, Jay K wrote:
> I don't know why I didn't get the reply in email, but this is representative of the real world code.
> 
>   - Jay
> 
> 
> From: Jay K <jayk123 AT hotmail DOT com>
> Sent: Wednesday, January 12, 2022 6:27 AM
> To: cygwin AT sourceware DOT org <cygwin AT sourceware DOT org>
> Subject: Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6
>   
> Ok, here is a small demonstration of the problem.
> 
> #include <stdlib.h>
> #include <stdio.h>
> #include <windows.h>
> 
> unsigned __stdcall thread(void* p)
> {
>    unsigned i;
>    for (i = 0; i < 100; ++i)
>     system("./a.exe");
>    return 0;
> }
> 
> int main()
> {
> unsigned i;
> HANDLE threads[100] = {0};
> FILE* f = fopen("a.c", "w");
> fprintf(f, "int main() { return 0; }\n");
> fclose(f);
> 
> system("g++ a.c");
> 
> for (i = 0; i < 100; ++i)
>   threads[i] = CreateThread(0, 0, thread, 0,0,0);
> 
> for (i = 0; i < 100; ++i)
>   WaitForSingleObject(threads[i], -1);
> 
> }

Again, Cygwin is designed to provide a POSIX-like interface.
Maybe you should just be using a Windows C compiler?

EM

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019