This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: semget() returns EAGAIN?


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: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]