17 #ifndef _TBB_mailbox_H 18 #define _TBB_mailbox_H 56 template<
intptr_t from_bit>
61 "Proxy's tag cannot specify both locations if the proxy " 62 "was retrieved from one of its original locations" );
63 if ( tat != from_bit ) {
107 #if __TBB_TASK_ISOLATION 109 while ( curr->prefix().isolation != isolation ) {
task_proxy *__TBB_atomic next_in_mailbox
Pointer to next task_proxy in a mailbox.
const isolation_tag no_isolation
void set_is_idle(bool value)
Indicate whether thread that reads this mailbox is idle.
const size_t task_prefix_reservation_size
Number of bytes reserved for a task prefix.
intptr_t drain()
Drain the mailbox.
tbb::atomic< int > my_task_count
Approximate number of tasks in mailbox to prevent an unlimited grow when the owner is not available.
#define __TBB_ISOLATION_EXPR(isolation)
bool push(task_proxy *t)
Push task_proxy onto the mailbox queue of another thread.
proxy_ptr *__TBB_atomic my_last
Pointer to pointer that will point to next item in the queue. Never NULL.
internal::task_prefix & prefix(internal::version_tag *=NULL) const
Get reference to corresponding task_prefix.
Base class for user-defined tasks.
bool is_idle_state(bool value) const
Indicate whether thread that reads this mailbox is idle.
task_proxy * pop(__TBB_ISOLATION_EXPR(isolation_tag isolation))
Get next piece of mail, or NULL if mailbox is empty.
mail_outbox * outbox
Mailbox to which this was mailed.
task_proxy *__TBB_atomic proxy_ptr
Internal representation of mail_outbox, without padding.
void pause()
Pause for a while.
void __TBB_store_relaxed(volatile T &location, V value)
Class representing source of mail.
static const intptr_t pool_bit
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
bool empty()
Return true if mailbox is empty.
mail_inbox()
Construct unattached inbox.
bool recipient_is_idle()
True if thread that owns this mailbox is looking for work.
intptr_t isolation_tag
A tag for task isolation.
proxy_ptr my_first
Pointer to first task_proxy in mailbox, or NULL if box is empty.
Pads type T to fill out to a multiple of cache line size.
#define __TBB_control_consistency_helper()
static const intptr_t mailbox_bit
Class representing where mail is put.
static const int mailbox_task_limit
void __TBB_EXPORTED_FUNC NFS_Free(void *)
Free memory allocated by NFS_Allocate.
static const intptr_t location_mask
const size_t NFS_MaxLineSize
Compile-time constant that is upper bound on cache line/sector size.
task * extract_task()
Returns a pointer to the encapsulated task or NULL, and frees proxy if necessary.
Class that implements exponential backoff.
void attach(mail_outbox &putter)
Attach inbox to a corresponding outbox.
bool my_is_idle
Owner of mailbox is not executing a task, and has drained its own task pool.
void detach()
Detach inbox from its outbox.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
static task * task_ptr(intptr_t tat)
Returns a pointer to the encapsulated task or NULL.
mail_outbox * my_putter
Corresponding sink where mail that we receive will be put.
T __TBB_load_relaxed(const volatile T &location)
atomic< T > & as_atomic(T &t)
bool empty()
Return true if mailbox is empty.
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
T __TBB_load_with_acquire(const volatile T &location)
void construct()
Construct *this as a mailbox from zeroed memory.
task_proxy * internal_pop(__TBB_ISOLATION_EXPR(isolation_tag isolation))
static bool is_shared(intptr_t tat)
True if the proxy is stored both in its sender's pool and in the destination mailbox.