MCPcopy Create free account
hub / github.com/NthTensor/Forte / new

Method new

src/thread_pool.rs:114–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112 /// seat (to ensure the `!Sync` bound is respected).
113 pub sharers: [Sharer<JobRef>; 32],
114 /// The stealing side of each seat's work-stealing queue.
115 pub stealers: [Stealer<JobRef>; 32],
116 /// A set of queues used for transmitting work that must be executed on a
117 /// particular worker. Used for broadcasts and cross-thread nonsend worker
118 /// wakeups.
119 pub broadcasts: [SegQueue<JobRef>; 32],
120 /// A binary semaphore for each seat, used for signaling.
121 pub semaphores: [Semaphore; 32],
122}
123
124impl MemberData {
125 fn new() -> MemberData {
126 let sharers: [Sharer<JobRef>; 32] =
127 array::from_fn(|_| Sharer::new(Worker::STEAL_QUEUE_CAPACITY));
128 let stealers: [Stealer<JobRef>; 32] =
129 array::from_fn(|i| sharers[i].stealer());
130 let broadcasts = array::from_fn(|_| SegQueue::new());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected