pub struct EventProducer<M> { /* private fields */ }Expand description
The owning thread’s write handle, stored in a thread_local.
Implementations§
Source§impl<M> EventProducer<M>
impl<M> EventProducer<M>
Sourcepub fn push(&self, m: M)
pub fn push(&self, m: M)
Appends one event: a plain slot store plus a Release publish of the
new length. Allocates a fresh chunk every CHUNK_SIZE events.
Examples found in repository?
examples/throughput.rs (line 71)
63fn produce(producer: usize, lockstep: &Lockstep) {
64 for round in 0..ROUNDS {
65 for i in 0..BATCH {
66 let event = Event {
67 producer,
68 seq: round * BATCH + i,
69 payload: Box::new([i as u8; 16]),
70 };
71 let _ = PRODUCER.try_with(|p| p.push(event));
72 }
73 lockstep.batch_pushed.wait();
74 lockstep.sweep_done.wait();
75 }
76}Trait Implementations§
Source§impl<M> Drop for EventProducer<M>
impl<M> Drop for EventProducer<M>
Auto Trait Implementations§
impl<M> !Freeze for EventProducer<M>
impl<M> !RefUnwindSafe for EventProducer<M>
impl<M> !Send for EventProducer<M>
impl<M> !Sync for EventProducer<M>
impl<M> !UnwindSafe for EventProducer<M>
impl<M> Unpin for EventProducer<M>
impl<M> UnsafeUnpin for EventProducer<M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more