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

Sven Barth pascaldragon at googlemail.com
Fri Oct 9 17:10:10 CEST 2015


Am 09.10.2015 16:37 schrieb "Kiên Nguyễn Tiến Trung" <kc97ble at gmail.com>:
>
> 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.

That is not necessarily a deadlock. It just blocks until the receiving
profess is ready to process more input. Of course you should process it's
output, cause if it can't write into its output anymore it can't normally
read from its input either ;)
That said you could write into the Input in a separate thread, this way
your GUI stays responsive.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151009/e647d75b/attachment-0003.html>


More information about the Lazarus mailing list