spdl.pipeline.SharedMemoryRingBuffer¶
- class SharedMemoryRingBuffer(capacity: int)[source]¶
[Experimental] A single shared-memory ring buffer for cross-process payloads.
Construct it in the parent process and pass it to
spdl.pipeline.iterate_in_subprocess()via thearenaargument; ownership transfers to that call, which closes and unlinks it at teardown.Added in version 0.5.0.
- Parameters:
capacity – Size of the payload arena in bytes. Must be at least as large as the biggest single pipeline unit (the sum of the binaries offloaded from one item). Size it to the in-flight high-water mark, roughly
(buffer_size + 2) * max_unit_bytes.
Methods
close()Release this process's mapping of the segment.
Return the reader endpoint (call in the parent process).
Return the writer endpoint (call in the worker process).
unlink()Remove the segment from the system (call once, by the owner).
Attributes
Size of the payload arena in bytes.
Absolute byte count published by the writer.
Name of the underlying shared-memory segment.
Absolute byte count released by the reader.