MADNESS  version 0.9
Public Member Functions | List of all members
madness::Thread Class Reference

Simplified thread wrapper to hide pthread complexity. More...

#include <worldthread.h>

Inheritance diagram for madness::Thread:
Inheritance graph
[legend]
Collaboration diagram for madness::Thread:
Collaboration graph
[legend]

Public Member Functions

 Thread ()
 Default constructor ... must invoke start() to actually begin the thread. More...
 
 Thread (void *(*f)(void *), void *args=0)
 Create a thread and start it running f(args) More...
 
void start (void *(*f)(void *), void *args=0)
 
virtual ~Thread ()
 
- Public Member Functions inherited from madness::ThreadBase
 ThreadBase ()
 Default constructor ... must invoke start() to actually begin the thread. More...
 
virtual ~ThreadBase ()
 
void start ()
 Start the thread running. More...
 
const pthread_t & get_id () const
 Get the pthread id of this thread (if running) More...
 
int get_pool_thread_index () const
 Get index of thread in ThreadPool (0,...,nthread-1) or -1 if not in ThreadPool. More...
 
int cancel () const
 Cancel this thread. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from madness::ThreadBase
static void exit ()
 A thread can call this to terminate its execution. More...
 
static int num_hw_processors ()
 Get no. of actual hardware processors. More...
 
static void set_affinity_pattern (const bool bind[3], const int cpu[3])
 Specify the affinity pattern or how to bind threads to cpus. More...
 
static void set_affinity (int logical_id, int ind=-1)
 
static ThreadBasethis_thread ()
 

Detailed Description

Simplified thread wrapper to hide pthread complexity.

Constructor & Destructor Documentation

madness::Thread::Thread ( )
inline

Default constructor ... must invoke start() to actually begin the thread.

madness::Thread::Thread ( void *(*)(void *)  f,
void *  args = 0 
)
inline

Create a thread and start it running f(args)

References madness::ThreadBase::start().

virtual madness::Thread::~Thread ( )
inlinevirtual

Member Function Documentation

void madness::Thread::start ( void *(*)(void *)  f,
void *  args = 0 
)
inline

The documentation for this class was generated from the following file: