Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Class representing where mail is put. More...
#include <mailbox.h>
Public Member Functions | |
bool | push (task_proxy *t) |
Push task_proxy onto the mailbox queue of another thread. More... | |
bool | empty () |
Return true if mailbox is empty. More... | |
void | construct () |
Construct *this as a mailbox from zeroed memory. More... | |
intptr_t | drain () |
Drain the mailbox. More... | |
bool | recipient_is_idle () |
True if thread that owns this mailbox is looking for work. More... | |
Private Member Functions | |
task_proxy * | internal_pop (__TBB_ISOLATION_EXPR(isolation_tag isolation)) |
Static Private Attributes | |
static const int | mailbox_task_limit = 32 |
Friends | |
class | mail_inbox |
Additional Inherited Members | |
![]() | |
typedef task_proxy *__TBB_atomic | proxy_ptr |
![]() | |
char | pad [S - R] |
![]() | |
proxy_ptr | my_first |
Pointer to first task_proxy in mailbox, or NULL if box is empty. More... | |
proxy_ptr *__TBB_atomic | my_last |
Pointer to pointer that will point to next item in the queue. Never NULL. More... | |
tbb::atomic< int > | my_task_count |
Approximate number of tasks in mailbox to prevent an unlimited grow when the owner is not available. More... | |
bool | my_is_idle |
Owner of mailbox is not executing a task, and has drained its own task pool. More... | |
Class representing where mail is put.
Padded to occupy a cache line.
|
inline |
Construct *this as a mailbox from zeroed memory.
Raise assertion if *this is not previously zeroed, or sizeof(this) is wrong. This method is provided instead of a full constructor since we know the object will be constructed in zeroed memory.
Definition at line 169 of file mailbox.h.
References __TBB_ASSERT, tbb::internal::unpadded_mail_outbox::my_first, tbb::internal::unpadded_mail_outbox::my_is_idle, tbb::internal::unpadded_mail_outbox::my_last, tbb::internal::NFS_MaxLineSize, tbb::internal::padded_base< unpadded_mail_outbox, NFS_MaxLineSize, sizeof(unpadded_mail_outbox) % NFS_MaxLineSize >::pad, and tbb::internal::suppress_unused_warning().
Referenced by tbb::internal::arena::arena().
|
inline |
Drain the mailbox.
Definition at line 179 of file mailbox.h.
References tbb::internal::unpadded_mail_outbox::my_first, tbb::internal::task_proxy::next_in_mailbox, tbb::internal::NFS_Free(), and tbb::internal::task_prefix_reservation_size.
Referenced by tbb::internal::arena::free_arena().
|
inline |
Return true if mailbox is empty.
Definition at line 161 of file mailbox.h.
References tbb::internal::__TBB_load_relaxed(), and tbb::internal::unpadded_mail_outbox::my_first.
Referenced by tbb::internal::mail_inbox::empty().
|
inlineprivate |
Definition at line 102 of file mailbox.h.
References __TBB_ASSERT, __TBB_control_consistency_helper, tbb::internal::__TBB_load_relaxed(), tbb::internal::as_atomic(), tbb::internal::unpadded_mail_outbox::my_first, tbb::internal::unpadded_mail_outbox::my_last, tbb::internal::unpadded_mail_outbox::my_task_count, tbb::internal::task_proxy::next_in_mailbox, tbb::internal::no_isolation, and tbb::internal::atomic_backoff::pause().
Referenced by tbb::internal::mail_inbox::pop().
|
inline |
Push task_proxy onto the mailbox queue of another thread.
Implementation is wait-free. Returns false if there are too many tasks.
Definition at line 147 of file mailbox.h.
References __TBB_ASSERT, tbb::internal::__TBB_store_relaxed(), mailbox_task_limit, tbb::internal::unpadded_mail_outbox::my_last, tbb::internal::unpadded_mail_outbox::my_task_count, and tbb::internal::task_proxy::next_in_mailbox.
Referenced by tbb::internal::generic_scheduler::prepare_for_spawning().
|
inline |
True if thread that owns this mailbox is looking for work.
Definition at line 190 of file mailbox.h.
References tbb::internal::unpadded_mail_outbox::my_is_idle.
Referenced by tbb::internal::generic_scheduler::steal_task_from().
|
friend |
|
staticprivate |