This is the mail archive of the cygwin-developers@cygwin.com 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: cygthread::cygthread() hang


On Mon, Apr 14, 2003 at 07:31:37AM -0400, Joe Buehler wrote:
>Christopher Faylor wrote:
>>>Is there any way to avoid them?  For example, on a pipe read, does
>>>Windows have something like select() so that the reader thread can wait
>>>for a "terminate yourself" or a "data can be read from the pipe"
>>>condition?
>
>>If there was something like that, don't you think I'd be using it
>>rather than this kludge?  I instituted this change after all of the
>>complaints about pipe reads being slow.  This sped up reads but at the
>>expense of using TerminateThread, with all that entails.
>
>Is there something wrong with using ReadFileEx and WriteFileEx to do
>overlapped I/O?  The main thread can then use WaitForMultipleObjects
>and wait for signals OR I/O completion on the pipe (signalled by the
>callback routine).

How would you create a pipe with the FILE_FLAG_OVERLAPPED option as
is specified here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/synchronization_and_overlapped_input_and_output.asp

I really have thought about this.  Rather than have you offer obvious
suggestions and me essentially say "Yes, I've thought about this", maybe
a simple test case illustrating your idea would be best.

cgf


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