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: pipe replacement w/o TerminateThread


Implementation-wise, this might actually be similar to the current
implementation: another thread to do the blocking reading/writing
so the main thread can be interrupted. But don't terminate the
reader/writer thread when a read or write is interrupted, let it keep running,
doing the appropriate thing depending on whether the main thread
is waiting for data or off doing something else. If it gets data
from the other end of the pipe, put it in a buffer and wait for
the main thread to come get it before going to read more. If it
finishes writing data to the pipe, let it go back and wait for more
from the main thread. The front-end can buffer internally if this
benefits performance.

It looks like this is pretty much what TCL does under Windows. Check out tclWinPipe.c at tcl.apache.org. -- Joe Buehler


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