[Lazarus] Prevent from deadlock while writing something large to a pipe

Kiên Nguyễn Tiến Trung kc97ble at gmail.com
Fri Oct 9 16:37:11 CEST 2015


I want to send a big amount of data to a child process through pipe.
However, it is stated in the documentation that writing too much into the
pipe may cause a deadlock.
TProcess.Input

Input is a stream which is connected to the process' standard input file
handle. Anything written to this stream can be read by the process.

The Input stream is only instantiated when the poUsePipes flag is used in
Options
<http://lazarus-ccr.sourceforge.net/docs/fcl/process/tprocess.options.html>.

Note that writing to the stream may cause the calling process to be
suspended when the created process is not reading from it's input, or to
cause errors when the process has terminated.

How can I prevent from deadlock?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151009/426ca84e/attachment-0002.html>


More information about the Lazarus mailing list