TBCI Numerical high perf. C++ Library 2.8.0
smp.h File Reference
#include "tbci/basics.h"
Include dependency graph for smp.h:

Go to the source code of this file.

Classes

struct  job_input
struct  job_output
struct  thr_struct
struct  thr_ctrl

Macros

#define THREAD_MAX_ARGS   6
#define THREAD_MAX_RES_LN   16
#define MAIN_PID   (getpid())
#define num_threads   (0)
#define thrno   (0)
#define ismainthread   (1)
#define threads_avail(x)

Typedefs

typedef void(* thr_job_t) (struct thr_ctrl *)
 Before the double inclusion guard on purpose!
typedef void *(* useful_job_t) (void *)

Functions

struct thr_struct ALIGN (64)
static int init_threads (const int=0, const bool=false)
static void bind_threads (bool=true, bool=true, bool=false)
static void free_threads ()
static void disable_threads ()
static void reenable_threads ()

Variables

int t_no
pid_t t_pid
pthread_t t_id
int t_pipe_to_thread [2]
int t_pipe_from_thread [2]
unsigned int t_done_var
int numa_node
struct thr_ctrl ALIGN

Detailed Description

Multithreading support framework based on POSIX threads. Control via TBCI::thr_ctrl

Author
Kurt Garloff
Date
1998-11-02
Version
Id
smp.h,v 1.25.2.59 2019/06/03 16:49:32 garloff Exp

License: GNU LGPL

Definition in file smp.h.

Macro Definition Documentation

◆ ismainthread

#define ismainthread   (1)

Definition at line 321 of file smp.h.

◆ MAIN_PID

#define MAIN_PID   (getpid())

Definition at line 317 of file smp.h.

◆ num_threads

#define num_threads   (0)

Definition at line 319 of file smp.h.

◆ THREAD_MAX_ARGS

#define THREAD_MAX_ARGS   6

Definition at line 129 of file smp.h.

Referenced by _thread_start_off().

◆ THREAD_MAX_RES_LN

#define THREAD_MAX_RES_LN   16

Definition at line 130 of file smp.h.

Referenced by dot(), and Vector< T >::operator*().

◆ threads_avail

◆ thrno

#define thrno   (0)

Definition at line 320 of file smp.h.

Typedef Documentation

◆ thr_job_t

typedef void(* thr_job_t) (struct thr_ctrl *)

Before the double inclusion guard on purpose!

Definition at line 126 of file smp.h.

◆ useful_job_t

typedef void *(* useful_job_t) (void *)

Definition at line 127 of file smp.h.

Function Documentation

◆ ALIGN()

struct thr_struct ALIGN ( 64 )

◆ bind_threads()

void bind_threads ( bool = true,
bool = true,
bool = false )
static

Definition at line 324 of file smp.h.

◆ disable_threads()

void disable_threads ( )
static

Definition at line 326 of file smp.h.

◆ free_threads()

void free_threads ( )
static

Definition at line 325 of file smp.h.

◆ init_threads()

int init_threads ( const int = 0,
const bool = false )
static

Definition at line 323 of file smp.h.

◆ reenable_threads()

void reenable_threads ( )
static

Definition at line 332 of file smp.h.

Variable Documentation

◆ ALIGN

struct thr_ctrl ALIGN

◆ numa_node

int numa_node

Definition at line 5 of file smp.h.

◆ t_done_var

unsigned int t_done_var

Definition at line 4 of file smp.h.

◆ t_id

pthread_t t_id

Definition at line 2 of file smp.h.

◆ t_no

int t_no

Definition at line 0 of file smp.h.

◆ t_pid

pid_t t_pid

Definition at line 1 of file smp.h.

◆ t_pipe_from_thread

int t_pipe_from_thread[2]

Definition at line 3 of file smp.h.

◆ t_pipe_to_thread

int t_pipe_to_thread[2]

Definition at line 3 of file smp.h.