|
VLink
2.3.0
A high-performance communication middleware
|
Fixed-depth publisher pool that recycles FastBuffer allocations by generation.
更多...
类 | |
| class | vlink::zerocopy::FastBufferPool |
| Owns a fixed set of equally sized allocations and recycles them in round-robin order. 更多... | |
命名空间 | |
| vlink | |
| vlink::zerocopy | |
Fixed-depth publisher pool that recycles FastBuffer allocations by generation.
A publisher of shared descriptors must neither overwrite an allocation that importers still read nor wait for them. FastBufferPool owns depth allocations of one size and hands out the next one whose readers have all released it. The manager increments that allocation's generation first, so descriptors published earlier for it fail to import as expired instead of observing overwritten bytes. Dead reader processes are purged by identity, so a crashed subscriber never pins a slot.
| Call | Effect |
|---|---|
create(size, depth) | Allocates depth uninitialised buffers through the provider |
acquire(buffer) | Clears buffer, then retains the next reusable slot |
clear() | Releases the slots; retained buffers keep theirs alive |
depth larger than the deepest subscriber queue plus the frames a subscriber retains; slower subscribers then drop expired frames rather than stalling the publisher. One thread drives a pool.