Product Documentation
Cadence Interprocess Communication SKILL Reference
Product Version IC23.1, June 2023

ipcReadProcess

ipcReadProcess( 
o_childId 
[ x_timeOut ] 
)
=> t_data / nil

Description

Reads data from the child process stdout channel, allowing the developer to specify a time, in seconds, beyond which the read operation must not block. It only reads 4096 bytes for each call.

This function takes the child process’s handle o_childId and an integer value x_timeOut denoting a permitted time, in seconds, beyond which the read operation must not block. Zero is an acceptable value and is a request for a non-blocking read where only buffered data is returned. If data is not available during the allowed time, nil is returned.

In the ensuing block caused by a read, incoming data from other child processes is buffered and, once the blocking read releases, all buffers are scanned and data is dealt with accordingly.

A blocking read freezes the parent process’s user interface graphics.

The ipcReadProcess function takes a finite number of seconds to time-out a block, therefore, deadlocks cannot occur. A deadlock occurs when two or more processes block indefinitely while waiting for each other to release a needed resource. The data retrieved by ipcReadProcess is not labeled as to its originating port, such as, stderr or stdout. You can either parse the data to determine the origin or use errHandler to always trap the errors.

When a blocking read is in progress, the user interface graphics become inactive. Child processes, however, can continue to communicate during the ensuing block, and send SKILL commands (if the child process is invoked by ipcBatchProcess) that are executed and their results returned. If an error handler is defined, error messages are buffered rather than given to the blocking read. The activation of the error handler occurs immediately after the read releases. Termination messages are received and any post functions defined are called. This allows a blocking read to release if the corresponding child terminates. Data from other child processes is buffered and dealt with after ipcReadProcess.

Arguments

o_childId

Child process handle.

x_timeOut

Integer value denoting a permitted time, in seconds, beyond which the read operation must not block. Zero is an acceptable value and is a request for a non-blocking read where only buffered data is returned.

Value Returned

t_data

Data made available during the allowed time.

nil

Data is not made available during the allowed time.

Examples

      cid = ipcBeginProcess("hostname")
ipc:3
ipcReadProcess(cid)
"foghorn\n"

Related Topics

Interprocess Communication Functions

ipcBeginProcess

ipcWriteProcess


Return to top
 ⠀
X