| /oneTBB/src/tbbmalloc/ |
| H A D | Statistics.h | 59 static inline int STAT_increment(int thread, int bin, int ctr) in STAT_increment() argument 61 …return reportAllocationStatistics && thread < MAX_THREADS ? ++(statistic[thread][bin].counter[ctr]… in STAT_increment() 76 static inline void STAT_print(int thread) in STAT_print() argument 83 sprintf(filename, "stat_ScalableMalloc_proc%04d_thr%04d.log", getpid(), thread); in STAT_print() 85 sprintf(filename, "stat_ScalableMalloc_thr%04d.log", thread); in STAT_print() 90 bin_counters& ctrs = statistic[thread][i]; in STAT_print() 91 fprintf(outfile, "Thr%04d Bin%02d", thread, i); in STAT_print() 104 bin_counters& ctrs = statistic[thread][i]; in STAT_print() 105 fprintf(outfile, "Thr%04d Bin%02d", thread, i); in STAT_print() 113 bin_counters& ctrs = statistic[thread][ThreadCommonCounters]; in STAT_print() [all …]
|
| /oneTBB/doc/main/tbb_userguide/design_patterns/ |
| H A D | GUI_Thread.rst | 12 A user interface thread must remain responsive to user requests, and 22 Graphical user interfaces often have a dedicated thread ("GUI 23 thread") for servicing user interactions. The thread must remain 27 thread takes part in the long running computation, it will not be 37 - The GUI thread services an event loop. 40 - The GUI thread needs to offload work onto other threads without 68 distinct from the calling thread. 71 by the GUI thread; items in blue are executed by another thread. 135 The GUI thread processes long computations as follows: 139 to a worker thread and immediately returns. [all …]
|
| H A D | Fenced_Data_Transfer.rst | 30 that preserves the order of a thread's operation from its viewpoint, 43 void Send( const std::string& src ) {. // Executed by thread 1 49 bool Receive( std::string& dst ) { // Executed by thread 2 99 void Send( const std::string& src ) {. // Executed by thread 1 105 bool Receive( std::string& dst ) { // Executed by thread 2 131 thread that acquires a lock on a mutex always sees any memory writes 132 done by another thread before it released a lock on that mutex.
|
| /oneTBB/doc/main/tbb_userguide/ |
| H A D | work_isolation.rst | 10 In |full_name|, a thread waiting for a 13 construct, a thread can obtain a task from the outer-level construct 32 The blocked thread is allowed to take tasks belonging to the first 34 might be simultaneously assigned to the same thread. In other words, 36 *unsequenced* even within a single thread. In most cases, this 38 parallelism available for the thread. 42 errors. For example, a thread-local variable might unexpectedly 51 // Set a thread specific value 77 // Set a thread specific value 92 calling thread to process only tasks scheduled in the scope of the [all …]
|
| H A D | appendix_A.rst | 8 threads. Each logical thread is serviced for a *time slice* by a 9 physical thread. If a thread runs longer than a time slice, as most do, 10 it relinquishes the physical thread until it gets another turn. This 16 registers for the previous logical thread that it was executing, and 17 load its registers for the next logical thread that it runs. 26 not a cache primer.) When a logical thread gets its time slice, as it 32 and subsequently thread B runs on the same physical thread, B will tend 34 data. When thread A gets its next time slice, it will need to reload 36 worse yet, the next time slice for thread A may be on a different 37 physical thread that has a different cache altogether. [all …]
|
| H A D | Task_Scheduler_Bypass.rst | 8 the spawning of the new task to be executed by the current thread involves the next steps: 10 - Push a new task onto the thread's deque. 12 - Take a task from the thread's deque, unless it is stolen by another thread. 17 the returned task becomes the first candidate for the next task to be executed by the thread. Furth… 18 the task is executed by the current thread and not by any other thread.
|
| H A D | Task-Based_Programming.rst | 34 when there is exactly one running logical thread per physical thread. 42 one logical thread per physical thread, and mapping tasks to logical 50 terminating a thread. On Windows systems, the ratio is more than 100. 51 This is because a thread has its own copy of a lot of resources, such as 52 register state and a stack. On Linux, a thread even has its own process 55 level (though its logical thread can be preempted). 60 called "fair", because each logical thread gets its fair share of time. 73 threads to balance load. With thread-based programming, you are often 85 they let you think at a higher, task-based, level. With thread-based 87 threads to get good efficiency, because you have one logical thread per [all …]
|
| H A D | How_Task_Scheduler_Works.rst | 16 - Preserve data locality to make a single thread execution more efficient 17 - Minimize both memory demands and cross-thread communication to reduce an overhead 32 Each thread has its deque of tasks that are ready to run. When a 33 thread spawns a task, it pushes it onto the bottom of its deque. 35 When a thread participates in the evaluation of tasks, it constantly executes 43 selected deque is empty, the thread tries again to execute this rule until it succeeds. 46 The overall effect of rule 2 is to execute the *youngest* task spawned by the thread, 47 which causes the depth-first execution until the thread runs out of work. 48 Then rule 3 applies. It steals the *oldest* task spawned by another thread,
|
| H A D | Lock_Pathologies.rst | 25 - Each thread holds at least one lock on a mutex, and is waiting on 26 a mutex for which the *next* thread in the cycle already has a 30 - No thread is willing to give up its lock. 62 when the operating system interrupts a thread that is holding a lock. 63 All other threads must wait until the interrupted thread resumes and 65 because if a waiting thread is interrupted, all the threads behind it
|
| H A D | Initializing_and_Terminating_the_Library.rst | 7 The initialization process is involved when a thread uses task scheduling services the first time, 9 The termination happens when the last such thread exits. 15 …n called with an instance of class ``oneapi::tbb::task_scheduler_handle`` blocks the calling thread 17 If waiting for thread completion is not safe, e.g. may result in a deadlock
|
| H A D | Concurrent_Queue_Classes.rst | 14 thread safety. 32 Even if each std::queue method were implemented in a thread-safe manner, 34 thread safe if there were other threads also popping from the same 36 before another thread snatches the last item from ``MySerialQueue``. 39 The equivalent thread-safe |full_name| code is: 55 guarantees that if a thread pushes two values, and another thread pops
|
| H A D | Floating_Point_Settings.rst | 8 …scheduler for a given application thread is initialized, they capture the current floating-point s… 11 …f the application thread. The settings are applied to all computations within that ``task_arena`` … 14 For better control over floating point behavior, a thread may capture the current settings in a tas… 46 …lel algorithm does not change the floating-point settings of the calling thread, even if the algor…
|
| H A D | When_Not_to_Use_Queues.rst | 17 - A thread that is popping a value may have to wait idly until the 21 - A queue is a passive data structure. If a thread pushes a value, it 24 yet, another thread pops the value, and the value (and whatever it
|
| H A D | Mapping_Nodes2Tasks.rst | 15 functions in oneTBB, the thread that calls ``wait_for_all`` is not spinning 42 try_put return control to the calling thread quickly, after either 46 blocks, as it should, and even in this case the calling thread may be 52 fewer threads, some spawned tasks will need to wait until a thread is
|
| H A D | appendix_B.rst | 40 and each thread executes the block statement associated with the pragma. 42 previously created thread team to execute the loop in parallel. 67 // Create thread for each outer loop iteration
|
| H A D | Mutual_Exclusion.rst | 10 on which a thread can acquire a lock. Only one thread at a time can have 14 The simplest mutex is ``spin_mutex``. A thread trying to acquire a lock 19 that only a single thread has access to ``FreeList`` at a time.
|
| H A D | destroy_graphs_outside_main_thread.rst | 6 Make sure to enqueue a task to wait for and destroy graphs that run outside the main thread. 8 You may not always want to block the main application thread by calling
|
| /oneTBB/examples/parallel_for/tachyon/src/ |
| H A D | pthread.cpp | 55 int pthread_create(pthread_t *thread, in pthread_create() argument 61 if (thread == nullptr) in pthread_create() 63 *thread = nullptr; in pthread_create() 76 *thread = th; in pthread_create()
|
| /oneTBB/test/tbbmalloc/ |
| H A D | test_malloc_init_shutdown.cpp | 81 std::thread& my_ward; 83 TestFunc2b (utils::SpinBarrier& barr, std::thread& t) : my_barr(&barr), my_ward(t) {} in TestFunc2b() 95 std::thread t2a; in Test2() 98 t2a = std::thread(func2a, std::size_t(0)); in Test2() 99 std::thread t2b(func2b, std::size_t(1)); in Test2()
|
| /oneTBB/test/tbb/ |
| H A D | test_eh_thread.cpp | 101 Thread thread; variable 102 if (thread.isValid()) { 104 thread.join();
|
| H A D | test_resumable_tasks.cpp | 45 m_asyncThreads.push_back( new std::thread(AsyncActivity::asyncLoop, this) ); in AsyncActivity() 89 std::vector<std::thread*> m_asyncThreads; 93 SuspendBody(AsyncActivity& a_, std::thread::id id) : in SuspendBody() 102 std::thread::id thread_id; 193 m_asyncThreads.push_back( new std::thread(EpochAsyncActivity::asyncLoop, this) ); in EpochAsyncActivity() 240 std::vector<std::thread*> m_asyncThreads;
|
| H A D | test_global_control.cpp | 223 std::thread thr([] { tbb::parallel_for(0, 1, [](int) {}); } ); in __anon8f1bc23b0302() 257 std::thread thr1([&] { in __anon8f1bc23b0502() 265 std::thread thr2([] { in __anon8f1bc23b0602()
|
| H A D | test_task.cpp | 227 std::vector<std::thread> pfor_threads; 239 for (auto& thread : pfor_threads) { variable 240 if (thread.joinable()) { 241 thread.join(); 275 std::vector<std::thread> threads; 281 for (auto& thread : threads) { variable 282 if (thread.joinable()) { 283 thread.join(); 671 tbb::task_arena test_arena{int(std::thread::hardware_concurrency() + 1)}; 795 std::vector<std::thread> high_priority_threads;
|
| /oneTBB/test/conformance/ |
| H A D | conformance_resumable_tasks.cpp | 36 std::thread t; 39 t = std::thread([sp, &resume] { in __anon366fea4d0102()
|
| /oneTBB/test/common/ |
| H A D | graph_utils.h | 543 std::thread t([&] { 587 std::thread t([&] { 693 std::thread::id this_id = std::this_thread::get_id(); 707 output_tuple_type operator()(const std::thread::id& input) noexcept { 713 void increase_and_check(const std::thread::id& input) { 715 std::thread::id body_thread_id = std::this_thread::get_id(); 745 std::thread::id this_id = std::this_thread::get_id(); 773 void increase_and_check(const std::thread::id& /*input*/) { 789 void operator()(const std::thread::id& input, gateway_type&) noexcept(NoExcept) { 792 output_tuple_type operator()(const std::thread::id& input) noexcept(NoExcept) { [all …]
|