IBM Streams 4.2
threadedPort
- type:
- queue(port, Sys.CongestionPolicy policy, int32 queueSize)
- Where queueSize must be >= 1.
- example:
- config threadedPort : queue(P1, Sys.Wait, 10), queue(P2, Sys.DropFirst);
- description:
- Process tuples that arrive on each named
input port in a separate thread, even if this operator is fused. That
means that a fused upstream operator, instead of directly calling
this port, merely deposits the tuple in a queue that is associated
with the port. The queue keeps tuples in arrival order. A dedicated
thread for this port then picks up the tuple from the queue when it
is ready. That allows for more concurrent execution of operators,
especially in the same partition. A maximum size for the queue can
be specified. A congestion mode is also specified as part of a threaded
port. There are three valid values for the congestion policy:
- Wait
- DropFirst
- DropLast
Important: Punctuation is never dropped. Thus the blocking behavior can manifest even when DropLast or DropFirst policies are specified. - default:
- If the config is omitted, then under fusion, tuples that arrive on this port directly trigger the process function of the operator in the caller's thread. If the config is present but the optional queue size is omitted, the compiler or the middleware decides the queue size.
- where:
- Any operator invocation of a non-composite operator.
For information about controlling the mechanism that is used when the threaded port is waiting on a full queue, see the --avoid-runtime-yield compiler option in the sc command.