PRB: Process.waitFor() Enters a Deadlock When Parent Process Does Not Read Child Process Data (326709)
The information in this article applies to:
- Microsoft Visual J# .NET (2002)
- Microsoft Visual J# .NET (2003)
This article was previously published under Q326709 SYMPTOMSProcess.waitFor() appears to enter a deadlock when the child process writes a lot
of data to its output stream and the parent process never reads the data.
CAUSE The Runtime.exec() method creates a pipe for the standard output. When the child
process writes a large amount of data to this pipe so that the buffer is full,
it blocks on the pipe until the data in the pipe buffer is read by the parent
process. If the parent process never reads the standard output, Process.waitFor() does not return. RESOLUTION To prevent blocking, make sure that the parent process
always reads the standard output from the child process. STATUSThis
behavior is by design.
Modification Type: | Major | Last Reviewed: | 8/7/2003 |
---|
Keywords: | kbStreaming kbprb KB326709 |
---|
|