This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: Pipe syncronization and incompatibility between Cygwin and .NET Framework 4.0
- From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr at ncbi dot nlm dot nih dot gov>
- To: James Johnston <JamesJ at motionview3d dot com>
- Cc: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Mon, 23 Dec 2013 19:05:05 +0000
- Subject: RE: Pipe syncronization and incompatibility between Cygwin and .NET Framework 4.0
- Authentication-results: sourceware.org; auth=none
- References: <02ee01cefdce$9c343300$d49c9900$ at motionview3d dot com> <5F8AAC04F9616747BC4CC0E803D5907D0C455040 at MLBXv04 dot nih dot gov> <030c01cefff6$9c1fa3c0$d45eeb40$ at motionview3d dot com>
> Check line 192 for a call to the WaitForAvailableConsoleInput function.
I guess they expect hFile to be a console handle (which IS waitable).
And my guess that they added the Peek intentionally to prevent
the WaitFor call from slipping through (as we've seen it does, otherwise)
on things that weren't supposed to be there (such as pipes).
They probably know of a side effect of peeking a pipe, which makes
the WaitFor API block on them (thus, still create a good cancellation
point for the thread) -- again, as they would not expect a pipe there (but
a good console handle; and if it isn't -- well, it's by design).
But I'm only speculating here. On the other hand, I would not be surprised
to learn that one team in MS would not know how to deal with the pipes and
introduced a bug, easily. MS is a large company, and I witnessed such
things to happen in teams of a much smaller scale, from my own experience.
In our apps we use the Peek everywhere for pipe polling, and do not
rely on anything else.
And from Cygwin point of view, I was trying to deal with mixing native
Windows things and UNIX, and it seems to be a big no-no, from the entire
design point -- Cygwin is not a tool for be-friending Windows and Unix,
rather a way to run your beloved GNU tools on a Windows box.
Sorry you ran into this trouble...
Anton Lavrentiev
Contractor NIH/NLM/NCBI
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple