public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: semget() returns EAGAIN?
Date: Wed, 07 Aug 2019 08:20:00 -0000	[thread overview]
Message-ID: <20190807082010.GZ11632@calimero.vinschen.de> (raw)
In-Reply-To: <20190807081242.GY11632@calimero.vinschen.de>

[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]

On Aug  7 10:12, Corinna Vinschen wrote:
> On Aug  7 05:02, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin wrote:
> > I'm noticing that in a high-contention situation (many processes try
> > to get ahold of a semaphore) semget() on Cygwin starts to return
> > EAGAIN (try again) after about 62 processes has gotten to call
> > semget() and are actively competing for the semaphore (i.e. using the
> > semaphore ID semget() returned to them).
> > 
> > EAGAIN is not documented in any of semget() API documentation that I
> > can find.
> > 
> > I understand that in Cygwin semget() is implemented as a connection to
> > cygserver, and the error probably stems from there, but I don't think
> > that such a code is appropriate as a final errno.  And why is there a
> > limit, to begin with?  What exactly imposes it?
> 
> The number of parallel open pipes, for instance.  By default, 10
> worker threads handle the load and up to 62 processes can be handled
> in parallel.  If the numbers are too low in your scenario, try to
> raise them in /etc/cygserver.conf.

Apart from that, the preferred way to use semaphores is to use POSIX
semaphores, that is, sem_open and friends.  These don't require
cygserver.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-08-07  8:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07  5:02 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2019-08-07  8:12 ` Corinna Vinschen
2019-08-07  8:20   ` Corinna Vinschen [this message]
2019-08-07 18:01 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin

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=20190807082010.GZ11632@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.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).