smp.cc File Reference

#include "smp.h"
#include <stdio.h>
#include <time.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/sysinfo.h>
#include <list.h>

Include dependency graph for smp.cc:

Go to the source code of this file.

Namespaces

namespace  TBCI

Classes

class  TBCI::cback

Defines

#define _GNU_SOURCE   1
#define NEED_SMP_DECLS   1
#define MAX_THREADS   160
#define TCHK(x)   x
#define ERRDECL
#define _cpu_relax()
#define POLL_REP   320
#define POLL_REPS   (POLL_REP/16)

Functions

static int TBCI::detect_num_cpu ()
static int TBCI::loadavg ()
void TBCI::thread_reg_callback (cbackfn ctor, cbackfn dtor, void *parm)
void TBCI::thread_dereg_callback (cbackfn ctor, cbackfn dtor, void *parm)
void TBCI::pthr_cond_signal_mutex (pthread_cond_t *cond, pthread_mutex_t *mut, volatile int *done)
int TBCI::pthr_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mut, volatile int *valptr)
void TBCI::lina_err (struct thr_ctrl *tc)
void TBCI::lina_empty (struct thr_ctrl *dummy)
void * TBCI::empty_thread (void *dummy)
void TBCI::pthread_mutex_bug_abort (struct thr_ctrl *tc, int err, const char *where)
void * TBCI::lina_thread (void *thr)
int TBCI::init_threads (const int thr=0)
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::free_threads ()
 Should be called on shutdown for multithreaded programs.
void TBCI::_thread_start_off (const int thr_no, thr_job_t job, const unsigned long off, const unsigned long sz, va_list vl)
void TBCI::thread_start_off (const int thr_no, thr_job_t job, const unsigned long offset, const unsigned long sz,...)
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_wait (const int)
void * TBCI::thread_wait_useful (const int, useful_job_t=0, void *=0)
long double TBCI::thread_wait_result (const int)
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.

Variables

int TBCI::threads_busy = 0
bool TBCI::threads_bound = false
static List< cback > TBCI::thread_cbacks
unsigned long TBCI::poll_succ = 0
unsigned long TBCI::poll_fail = 0
unsigned long TBCI::polls_succ = 0
unsigned long TBCI::polls_fail = 0
int TBCI::tot_cpu_tm


Detailed Description

Author:
Kurt Garloff
Date:
1998-11-02
Version:
Id
smp.cc,v 1.26.2.58.2.1 2011/03/21 20:32:40 garloff Exp
License: GNU LGPL

Definition in file smp.cc.


Define Documentation

 
#define _cpu_relax (  ) 

#define _GNU_SOURCE   1

Definition at line 59 of file smp.cc.

#define ERRDECL

#define MAX_THREADS   160

Definition at line 84 of file smp.cc.

Referenced by TBCI::init_threads().

#define NEED_SMP_DECLS   1

Definition at line 61 of file smp.cc.

#define POLL_REP   320

Definition at line 324 of file smp.cc.

Referenced by TBCI::pthr_cond_wait().

#define POLL_REPS   (POLL_REP/16)

Definition at line 327 of file smp.cc.

Referenced by TBCI::pthr_cond_signal_mutex().

#define TCHK (  )     x


Generated on Wed Nov 20 09:28:29 2013 for TBCI Numerical high perf. C++ Library by  doxygen 1.5.6