|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Multi-producer single-consumer - producer side. More...
#include <mpsc_shm.hpp>
Public Member Functions | |
| MpscProducer (MpscProducer &&other) noexcept | |
| MpscProducer & | operator= (MpscProducer &&other) noexcept |
| MpscProducer (const MpscProducer &)=delete | |
| MpscProducer & | operator= (const MpscProducer &)=delete |
| ~MpscProducer () | |
| void * | claim (size_t want, uint32_t timeout_ns) |
| Claim space in producer's ring. | |
| void | publish (size_t n) |
| Publish data to producer's ring (rings doorbell) | |
Static Public Member Functions | |
| static MpscProducer | connect (const std::string &name, size_t producer_id) |
| Connect to MPSC system as a producer. | |
Private Member Functions | |
| MpscProducer (SpscShm &&ring, int doorbell_fd, size_t doorbell_len, MpscDoorbell *doorbell, size_t producer_id) | |
Private Attributes | |
| SpscShm | ring_ |
| int | doorbell_fd_ = -1 |
| size_t | doorbell_len_ = 0 |
| MpscDoorbell * | doorbell_ = nullptr |
| size_t | producer_id_ = 0 |
Multi-producer single-consumer - producer side.
Connects to one SPSC ring and rings the shared doorbell when publishing.
Definition at line 113 of file mpsc_shm.hpp.
|
noexcept |
Definition at line 283 of file mpsc_shm.cpp.
|
delete |
| bb::ipc::MpscProducer::~MpscProducer | ( | ) |
Definition at line 323 of file mpsc_shm.cpp.
|
private |
Definition at line 274 of file mpsc_shm.cpp.
| void * bb::ipc::MpscProducer::claim | ( | size_t | want, |
| uint32_t | timeout_ns | ||
| ) |
Claim space in producer's ring.
| want | Bytes wanted |
| timeout_ns | Timeout in nanoseconds |
Definition at line 364 of file mpsc_shm.cpp.
|
static |
Connect to MPSC system as a producer.
| name | Base name for shared memory objects |
| producer_id | Producer ID (determines which ring to use) |
| std::runtime_error | if connection fails |
Definition at line 333 of file mpsc_shm.cpp.
|
delete |
|
noexcept |
Definition at line 296 of file mpsc_shm.cpp.
| void bb::ipc::MpscProducer::publish | ( | size_t | n | ) |
Publish data to producer's ring (rings doorbell)
| n | Bytes to publish |
Definition at line 369 of file mpsc_shm.cpp.
|
private |
Definition at line 151 of file mpsc_shm.hpp.
|
private |
Definition at line 149 of file mpsc_shm.hpp.
|
private |
Definition at line 150 of file mpsc_shm.hpp.
|
private |
Definition at line 152 of file mpsc_shm.hpp.
|
private |
Definition at line 148 of file mpsc_shm.hpp.