#include "basics.h"#include <signal.h>#include <cstdlib>#include <cstdarg>#include <sys/types.h>#include <pthread.h>


Go to the source code of this file.
Namespaces | |
| namespace | TBCI |
Classes | |
| struct | TBCI::thr_ctrl |
Defines | |
| #define | __need_sigset_t |
| Before the double inclusion guard on purpose! | |
| #define | _POSIX_C_SOURCE 200112L |
| #define | smp_barrier() asm ("": : :"memory") |
| #define | MAIN_PID (main_thread_pid) |
| #define | THREAD_MAX_ARGS 5 |
| #define | THREAD_MAX_RES_LN 16 |
Typedefs | |
| typedef void(* | TBCI::thr_job_t )(struct thr_ctrl *) |
| typedef void *(* | TBCI::useful_job_t )(void *) |
| typedef void | TBCI::cbackfn (void *ptr, const int thr) |
Functions | |
| int | TBCI::init_threads (const int thr=0) |
| void | TBCI::free_threads () |
| Should be called on shutdown for multithreaded programs. | |
| int | TBCI::threads_avail (const int=0) |
| Test availability of threads. | |
| void | TBCI::disable_threads () |
| Switch off multithreading. | |
| void | TBCI::reenable_threads () |
| Switch on multithreading again. | |
| void | TBCI::bind_threads (bool bind_main=false) |
| Set scheduling affinity of threads Rather than letting the OS decide which CPU a thread runs on, this makes sure a thread can only run on one CPU. | |
| void | TBCI::thread_start (const int thr_no, thr_job_t job, const unsigned long sz,...) |
| last arg must be (void*)0 ! | |
| void | TBCI::thread_start_off (const int thr_no, thr_job_t job, const unsigned long offset, const unsigned long sz,...) |
| void | TBCI::thread_wait (const int) |
| void * | TBCI::thread_wait_useful (const int, useful_job_t=0, void *=0) |
| long double | TBCI::thread_wait_result (const int) |
| template<typename T> | |
| static unsigned long | TBCI::slice_offset (int thr, int no_thr, unsigned long dim, T *ptr) |
| void | TBCI::thread_reg_callback (cbackfn ctor, cbackfn dtor, void *parm) |
| void | TBCI::thread_dereg_callback (cbackfn ctor, cbackfn dtor, void *parm) |
Variables | |
| pid_t | TBCI::main_thread_pid = 0 |
| bool | TBCI::bound_main = false |
| int | TBCI::num_threads = 0 |
| struct thr_ctrl * | TBCI::threads = 0 |
| int | TBCI::ismainthread = 1 |
| int | TBCI::thrno = 0 |
| struct thr_ctrl * | TBCI::this_thread = 0 |
Definition in file smp.h.
| #define __need_sigset_t |
| #define THREAD_MAX_ARGS 5 |
| #define THREAD_MAX_RES_LN 16 |
Definition at line 116 of file smp.h.
Referenced by TBCI::dot(), and TBCI::Vector< T >::operator*().
1.5.6