aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawktexi.in
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-01-18 06:20:39 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-01-18 06:20:39 +0200
commit07795bbecb05b4d2d52bd8808c713b0c5ece7b3b (patch)
tree6e0f5c49db9da0d8cd2093394e2bae0f8897b46e /doc/gawktexi.in
parentdd53cb380cc913ea1c2fa1a7df74c903adb2ef1a (diff)
downloadegawk-07795bbecb05b4d2d52bd8808c713b0c5ece7b3b.tar.gz
egawk-07795bbecb05b4d2d52bd8808c713b0c5ece7b3b.tar.bz2
egawk-07795bbecb05b4d2d52bd8808c713b0c5ece7b3b.zip
Improve doc on coprocesses.
Diffstat (limited to 'doc/gawktexi.in')
-rw-r--r--doc/gawktexi.in25
1 files changed, 21 insertions, 4 deletions
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index ec715346..8d721c29 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -26568,10 +26568,27 @@ print @dots{} |& command # start two-way pipe
@end example
@noindent
-Using ptys usually avoids the buffer deadlock issues described earlier, at some
-loss in performance. If your system does not have ptys, or if all the
-system's ptys are in use, @command{gawk} automatically falls back to
-using regular pipes.
+If your system does not have ptys, or if all the system's ptys are in use,
+@command{gawk} automatically falls back to using regular pipes.
+
+Using ptys usually avoids the buffer deadlock issues described earlier,
+at some loss in performance. This is because the tty driver buffers
+and sends data line-by-line. On systems with the @command{stdbuf}
+(part of the @uref{http://www.gnu.org/software/coreutils/coreutils.html,
+GNU Coreutils package}), you can use that program instead of ptys.
+
+Note also that ptys are not fully transparent. Certain binary control
+codes, such @kbd{Ctrl-d} for end-of-file, are interpreted by the tty
+driver and not passed through.
+
+@quotation CAUTION
+Finally, coprocesses open up the possibility of @dfn{deadlock} between
+@command{gawk} and the program running in the coprocess. This can occur
+if you send ``too much'' data to the coprocess before reading any back;
+each process is blocked writing data with noone available to read what
+they've already written. There is no workaround for deadlock; careful
+programming and knowledge of the behavior of the coprocess are required.
+@end quotation
@node TCP/IP Networking
@section Using @command{gawk} for Network Programming