A thread-safe list of N indexes (0 to size - 1).
RSlotStack can be used to atomically assign a "processing slot" number to each thread in multi-threaded applications. When there are no more slots available, the thread busy-waits for a slot. This case should be avoided by the scheduler.
Definition at line 25 of file RSlotStack.hxx.
Classes | |
struct | AtomicWrapper |
Public Member Functions | |
RSlotStack ()=delete | |
RSlotStack (unsigned int size) | |
unsigned int | GetSlot () |
void | ReturnSlot (unsigned int slotNumber) |
Private Attributes | |
std::vector< AtomicWrapper > | fSlots |
#include <ROOT/RSlotStack.hxx>
|
delete |
ROOT::Internal::RSlotStack::RSlotStack | ( | unsigned int | size | ) |
Definition at line 16 of file RSlotStack.cxx.
unsigned int ROOT::Internal::RSlotStack::GetSlot | ( | ) |
Definition at line 28 of file RSlotStack.cxx.
void ROOT::Internal::RSlotStack::ReturnSlot | ( | unsigned int | slotNumber | ) |
Definition at line 18 of file RSlotStack.cxx.
|
private |
Definition at line 39 of file RSlotStack.hxx.