libtmux Reference MCP Search
On this page

io.github.libtmux.transport.ProcessTransport.ProcessTransport

View as Markdown

Module
io.github.libtmux.transport.ProcessTransport
Package
io.github.libtmux:libtmux
Source
libtmux/src/main/java/io/github/libtmux/transport/ProcessTransport.java
class io.github.libtmux.transport.ProcessTransport.ProcessTransport
classreadonly [source]
classreadonly [source]
class io.github.libtmux.transport.ProcessTransport.ProcessTransport

The default transport: one child process per call, drained by a bounded pool of platform threads.

<p>A caller takes one admission permit before launching, and the pool holds exactly three workers per permit, so holding a permit means both drains and the input pump are already free. Without that coupling a caller can start a child whose pipes nobody is reading, or block forever writing to one that stopped reading.

<p>A request declared as waiting also takes one of all but one admission permits. The remaining process stays available for the ordinary request that observes or releases those waits, without increasing the total process or pump bound. An additional waiter is refused before dispatch, so its caller knows it was never registered.

<p>The caller itself may be a virtual thread: on JDK 21 Process.waitFor takes a ReentrantLock , so blocking there releases the carrier. The drains may not be, for two independent reasons. A process pipe read is monitor-locked, and — more decisively — a library does not own the scheduler. Any unrelated code blocking inside a monitor holds a carrier, and drains that need a virtual thread to run would then never run at all.

<p>Launching and closing are ordered by an explicit gate rather than a flag, because checking a flag and then acting on it lets a caller start a child after close() has already decided there was nothing left to destroy.

6 declared, 0 inherited

Members

Esc

Type to search.