public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: Jay K <jayk123@hotmail.com>,
	"cygwin@sourceware.org" <cygwin@sourceware.org>
Subject: Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6
Date: Thu, 13 Jan 2022 08:42:01 -0500	[thread overview]
Message-ID: <f8ec9d6b-23c6-ee02-4723-6e4831e22df6@cs.umass.edu> (raw)
In-Reply-To: <MWHPR1401MB195147B622BB5A90492E577AE6539@MWHPR1401MB1951.namprd14.prod.outlook.com>

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@hotmail.com>
> Sent: Wednesday, January 12, 2022 6:27 AM
> To: cygwin@sourceware.org <cygwin@sourceware.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

      reply	other threads:[~2022-01-13 13:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12  4:12 Jay K
2022-01-12  5:57 ` Jay K
2022-01-12  6:27   ` Jay K
2022-01-12  6:41     ` Marco Atzeri
2022-01-13 23:52       ` Takashi Yano
2022-01-14  0:11         ` Mark Geisert
2022-01-14  0:22           ` Takashi Yano
2022-01-13  6:40     ` Jay K
2022-01-13 13:42       ` Eliot Moss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8ec9d6b-23c6-ee02-4723-6e4831e22df6@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cygwin@sourceware.org \
    --cc=jayk123@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).