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: Possible race in SYSV IPC (semaphores)


> This should avoid the race (*and* work...)
> Please give it a try.

Thanks!  I've tried both patches (pipe race + semadj), and they do seem to work!

Although (not being a party pooper :-), I think that all the logic
around "pipe_instance" can now be dropped entirely, and benefit from eliminating
an unnecessary synchronization point (pipe_instance is now only used
for logging a proper pipe ID, which is not even seen in regular use,
and for an assert(), which again is only there in debug mode builds).
So there is no need to arrange Enter'ing/Leave'ing of the critical section
to do just the hidden things, yet the working code would be a bit cleaner.

Anton Lavrentiev
Contractor NIH/NLM/NCBI


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