Mailbox for multiple threads with arbitrary numbering. More...
Public Member Functions | |
template<typename Range > | |
mailbox (Range const &r) | |
mailbox (mailbox const &other) | |
size_type | size (void) const noexcept |
void | push (const id i, message_ptr m) |
Pushes the request to slot i . | |
void | push_any (message_ptr m) |
Pushes the request to any slot. More... | |
void | push_all (const bool, message_ptr m) |
Pushes the request to all slots. More... | |
template<typename Range > | |
void | push_range (Range const &r, const bool, message_ptr m) |
Pushes the request to the slots with ids in range r . More... | |
slot_type & | get_slot (const id i) noexcept |
Public Types | |
using | id = location_id |
using | slot_type = request_queue |
using | size_type = std::size_t |
Mailbox for multiple threads with arbitrary numbering.
It is a data structure that keeps requests that go to each thread and offers the ability to place a request to multiple threads.
This implementation is based on an associative container and therefore can accept arbitrary indexing for the individual slots.
void stapl::runtime::mailbox::push_any | ( | message_ptr | m | ) |
Pushes the request to any slot.
void stapl::runtime::mailbox::push_all | ( | const bool | , |
message_ptr | m | ||
) |
Pushes the request to all slots.
void stapl::runtime::mailbox::push_range | ( | Range const & | r, |
const bool | , | ||
message_ptr | m | ||
) |
Pushes the request to the slots with ids in range r
.