.TH "sc::ThreadGrp" 3 "Sun Oct 4 2020" "Version 2.3.1" "MPQC" \" -*- nroff -*- .ad l .nh .SH NAME sc::ThreadGrp \- The \fBThreadGrp\fP abstract class provides a means to manage separate threads of control\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBsc::DescribedClass\fP\&. .PP Inherited by \fBsc::ProcThreadGrp\fP, \fBsc::PthreadThreadGrp\fP, and \fBsc::PumaThreadGrp\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBThreadGrp\fP (const \fBRef\fP< \fBKeyVal\fP > &)" .br .ti -1c .RI "\fBThreadGrp\fP (const \fBThreadGrp\fP &, int \fBnthread\fP=\-1)" .br .ti -1c .RI "virtual void \fBadd_thread\fP (int threadnum, \fBThread\fP *thread)" .br .RI "Assigns a \fBThread\fP object to each thread\&. " .ti -1c .RI "virtual void \fBadd_thread\fP (int threadnum, \fBThread\fP *thread, int priority)" .br .RI "Like add_thread(threadnum, thread), but assign a priority that the thread is to use\&. " .ti -1c .RI "int \fBnthread\fP () const" .br .RI "The number of threads that will be run by start_thread\&. " .ti -1c .RI "void \fBdelete_threads\fP ()" .br .ti -1c .RI "virtual int \fBstart_threads\fP ()=0" .br .RI "Starts the threads running\&. " .ti -1c .RI "virtual int \fBwait_threads\fP ()=0" .br .RI "Wait for all the threads to complete\&. " .ti -1c .RI "virtual \fBRef\fP< \fBThreadLock\fP > \fBnew_lock\fP ()=0" .br .RI "Return a local object\&. " .ti -1c .RI "virtual \fBThreadGrp\fP * \fBclone\fP (int \fBnthread\fP=\-1)" .br .RI "Create a \fBThreadGrp\fP like the current one\&. " .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static void \fBset_default_threadgrp\fP (const \fBRef\fP< \fBThreadGrp\fP > &)" .br .ti -1c .RI "static \fBThreadGrp\fP * \fBget_default_threadgrp\fP ()" .br .ti -1c .RI "static \fBThreadGrp\fP * \fBinitial_threadgrp\fP (int &argc, char **argv)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "\fBThread\fP ** \fBthreads_\fP" .br .ti -1c .RI "int \fBnthread_\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBThreadGrp\fP abstract class provides a means to manage separate threads of control\&. .SH "Member Function Documentation" .PP .SS "virtual void sc::ThreadGrp::add_thread (int threadnum, \fBThread\fP * thread)\fC [virtual]\fP" .PP Assigns a \fBThread\fP object to each thread\&. If 0 is assigned to a thread, then that thread will be skipped\&. .PP Reimplemented in \fBsc::PthreadThreadGrp\fP\&. .PP Referenced by sc::PthreadThreadGrp::add_thread()\&. .SS "virtual void sc::ThreadGrp::add_thread (int threadnum, \fBThread\fP * thread, int priority)\fC [virtual]\fP" .PP Like add_thread(threadnum, thread), but assign a priority that the thread is to use\&. The member is primarily for experimentation, the priority argument is currently not well defined and ignored\&. .br .PP Reimplemented in \fBsc::PthreadThreadGrp\fP\&. .SS "virtual \fBThreadGrp\fP* sc::ThreadGrp::clone (int nthread = \fC\-1\fP)\fC [virtual]\fP" .PP Create a \fBThreadGrp\fP like the current one\&. If nthread is given, the new \fBThreadGrp\fP will attempt to support that number of threads, but the actual number supported may be less\&. If nthread is -1, the number of threads in the current group will be used\&. .PP Reimplemented in \fBsc::ProcThreadGrp\fP, and \fBsc::PthreadThreadGrp\fP\&. .SS "virtual int sc::ThreadGrp::start_threads ()\fC [pure virtual]\fP" .PP Starts the threads running\&. \fBThread\fP 0 will be run by the thread that calls start_threads\&. .PP Implemented in \fBsc::ProcThreadGrp\fP, \fBsc::PumaThreadGrp\fP, and \fBsc::PthreadThreadGrp\fP\&. .SS "virtual int sc::ThreadGrp::wait_threads ()\fC [pure virtual]\fP" .PP Wait for all the threads to complete\&. This must be called before start_threads is called again or the object is destroyed\&. .PP Implemented in \fBsc::ProcThreadGrp\fP, \fBsc::PumaThreadGrp\fP, and \fBsc::PthreadThreadGrp\fP\&. .SH "Author" .PP Generated automatically by Doxygen for MPQC from the source code\&.