Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
A buffer of input items for a filter. More...
Public Member Functions | |
input_buffer (bool is_ordered_, bool is_bound_) | |
Construct empty buffer. More... | |
~input_buffer () | |
Destroy the buffer. More... | |
bool | put_token (task_info &info_, bool force_put=false) |
Put a token into the buffer. More... | |
template<typename StageTask > | |
void | note_done (Token token, StageTask &spawner) |
Note that processing of a token is finished. More... | |
bool | return_item (task_info &info, bool advance) |
return an item, invalidate the queued item, but only advance if the filter More... | |
bool | has_item () |
true if the current low_token is valid. More... | |
void | create_my_tls () |
void | destroy_my_tls () |
bool | my_tls_end_of_input () |
void | set_my_tls_end_of_input () |
Private Types | |
typedef Token | size_type |
typedef basic_tls< intptr_t > | end_of_input_tls_t |
for parallel filters that accepts NULLs, thread-local flag for reaching end_of_input More... | |
Private Member Functions | |
void | grow (size_type minimum_size) |
Resize "array". More... | |
void | create_sema (size_t initial_tokens) |
void | free_sema () |
void | sema_P () |
void | sema_V () |
![]() | |
no_copy (const no_copy &)=delete | |
no_copy ()=default | |
Private Attributes | |
task_info * | array |
Array of deferred tasks that cannot yet start executing. More... | |
semaphore * | my_sem |
for thread-bound filter, semaphore for waiting, NULL otherwise. More... | |
size_type | array_size |
Size of array. More... | |
Token | low_token |
Lowest token that can start executing. More... | |
spin_mutex | array_mutex |
Serializes updates. More... | |
Token | high_token |
Used for out of order buffer, and for assigning my_token if is_ordered and my_token not already assigned. More... | |
bool | is_ordered |
True for ordered filter, false otherwise. More... | |
bool | is_bound |
True for thread-bound filter, false otherwise. More... | |
end_of_input_tls_t | end_of_input_tls |
bool | end_of_input_tls_allocated |
Static Private Attributes | |
static const size_type | initial_buffer_size = 4 |
Initial size for "array". More... | |
Friends | |
class | tbb::internal::pipeline_root_task |
class | tbb::filter |
class | tbb::thread_bound_filter |
class | tbb::internal::stage_task |
class | tbb::pipeline |
A buffer of input items for a filter.
Each item is a task_info, inserted into a position in the buffer corresponding to a Token.
Definition at line 48 of file pipeline.cpp.
|
private |
for parallel filters that accepts NULLs, thread-local flag for reaching end_of_input
Definition at line 92 of file pipeline.cpp.
|
private |
Definition at line 55 of file pipeline.cpp.
|
inline |
Construct empty buffer.
Definition at line 103 of file pipeline.cpp.
References __TBB_ASSERT.
|
inline |
Destroy the buffer.
Definition at line 114 of file pipeline.cpp.
References __TBB_ASSERT, and tbb::internal::poison_pointer().
|
inline |
Definition at line 225 of file pipeline.cpp.
References tbb::internal::basic_tls< T >::create(), and tbb::internal::handle_perror().
Referenced by tbb::internal::pipeline_cleaner::~pipeline_cleaner().
|
inlineprivate |
Definition at line 96 of file pipeline.cpp.
References __TBB_ASSERT.
|
inline |
Definition at line 226 of file pipeline.cpp.
References tbb::internal::basic_tls< T >::destroy(), and tbb::internal::handle_perror().
|
inlineprivate |
Definition at line 97 of file pipeline.cpp.
References __TBB_ASSERT.
Resize "array".
Caller is responsible to acquiring a lock on "array_mutex".
Definition at line 231 of file pipeline.cpp.
References tbb::internal::task_info::is_valid, and new_size.
|
inline |
true if the current low_token is valid.
Definition at line 222 of file pipeline.cpp.
References tbb::internal::task_info::is_valid, and lock.
|
inline |
Definition at line 227 of file pipeline.cpp.
References tbb::internal::basic_tls< T >::get().
|
inline |
Note that processing of a token is finished.
Fires up processing of the next token, if processing was deferred.
Definition at line 174 of file pipeline.cpp.
References tbb::filter::finalize(), tbb::internal::task_info::is_valid, ITT_NOTIFY, lock, tbb::internal::task_info::my_object, and tbb::internal::task_info::reset().
|
inline |
Put a token into the buffer.
If task information was placed into buffer, returns true; otherwise returns false, informing the caller to create and spawn a task. If input buffer owned by thread-bound filter and the item at low_token was not valid, issue a V() If the input_buffer is owned by a successor to a thread-bound filter, the force_put parameter should be true to ensure the token is inserted in the buffer.
Definition at line 135 of file pipeline.cpp.
References __TBB_ASSERT, tbb::internal::task_info::is_valid, ITT_NOTIFY, lock, tbb::internal::task_info::my_token, tbb::internal::task_info::my_token_ready, and sync_releasing.
|
inline |
return an item, invalidate the queued item, but only advance if the filter
Definition at line 208 of file pipeline.cpp.
References tbb::internal::task_info::is_valid, ITT_NOTIFY, and lock.
Referenced by tbb::internal::pipeline_root_task::execute().
|
inlineprivate |
Definition at line 98 of file pipeline.cpp.
References __TBB_ASSERT, and tbb::internal::semaphore::P().
|
inlineprivate |
Definition at line 99 of file pipeline.cpp.
References __TBB_ASSERT, and tbb::internal::semaphore::V().
|
inline |
Definition at line 228 of file pipeline.cpp.
References tbb::internal::basic_tls< T >::set().
|
friend |
Definition at line 50 of file pipeline.cpp.
|
friend |
Definition at line 49 of file pipeline.cpp.
|
friend |
Definition at line 52 of file pipeline.cpp.
|
friend |
Definition at line 53 of file pipeline.cpp.
|
friend |
Definition at line 51 of file pipeline.cpp.
|
private |
Array of deferred tasks that cannot yet start executing.
Definition at line 58 of file pipeline.cpp.
|
private |
Serializes updates.
Definition at line 72 of file pipeline.cpp.
|
private |
|
private |
Definition at line 93 of file pipeline.cpp.
|
private |
Definition at line 94 of file pipeline.cpp.
|
private |
Used for out of order buffer, and for assigning my_token if is_ordered and my_token not already assigned.
Definition at line 83 of file pipeline.cpp.
|
staticprivate |
|
private |
True for thread-bound filter, false otherwise.
Definition at line 89 of file pipeline.cpp.
|
private |
True for ordered filter, false otherwise.
Definition at line 86 of file pipeline.cpp.
|
private |
Lowest token that can start executing.
All prior Token have already been seen.
Definition at line 69 of file pipeline.cpp.
|
private |
for thread-bound filter, semaphore for waiting, NULL otherwise.
Definition at line 61 of file pipeline.cpp.