HPCxx_Thread

The implementation of HPC++ uses a model of threads that is based on a Thread class, which is by design similar to the Java thread system. More specifically, there are two basic classes that are used to instantiate a thread and get it to do something. Basic Thread objects excapsulate a thread and provide a private data space. Objects of class Runnable provide a convenient way for a set of threads to execute the member functions of a shared object.

Class Definition

class HPCxx_Thread{
   public:
       HPCxx_Thread(const char *name = NULL);
       HPCxx_Thread(HPCxx_Runnable *runnable, 
                    const char *name = NULL);
       virtual ~HPCxx_Thread();
       HPCxx_Thread& operator=(const HPCxx_Thread& thread);
       virtual void run();
       static void stop(void *status);
       static void yield();
       void resume();
       int isAlive();
       static HPCxx_Thread *currentThread();
       void join(long milliseconds = 0, 
                 long nanoseconds = 0);
       void setName(const char *name);
       const char *getName();
       int getPriority();
       int setPriority(int priority);
       static void sleep(long milliseconds, 
                         long nanoseconds = 0);
       void suspend();
       void start();
 };
    

Examples
hpc++@extreme.indiana.edu

Last modified: Thu Apr 22 00:23:56 EST 1999