Loading...
Searching...
No Matches
LibThread::ThreadPool Class Reference

## Public Member Functions

| ThreadPool (Scheduler *sched, int n)
| ThreadPool (int n)
| ~ThreadPool ()
ThreadState * | getThread (int i)
void | shutdown (bool wait)
void | addThread (ThreadState *thread)
void | attachJob (Job *job)
void | detachJob (Job *job)
void | queueJob (Job *job)
void | broadcastJob (Job *job)
void | cancelDeps (Job *job)
void | cancelJob (Job *job)
void | waitJob (Job *job)
void | clearThreadState ()
Public Member Functions inherited from LibThread::SharedObject
| SharedObject ()
virtual | ~SharedObject ()
void | set_type (int type_init)
int | get_type ()
void | set_name (std::string &name_init)
void | set_name (const char *s)
std::string & | get_name ()
void | incref (int by=1)
long | decref ()
long | getref ()
virtual BOOLEAN | op2 (int op, leftv res, leftv a1, leftv a2)
virtual BOOLEAN | op3 (int op, leftv res, leftv a1, leftv a2, leftv a3)

## Data Fields

Scheduler * | scheduler
int | nthreads

## Detailed Description

Definition at line 1628 of file shared.cc.

## Constructor & Destructor Documentation

## ThreadPool() [1/2]

LibThread::ThreadPool::ThreadPool | ( | Scheduler * | sched,
|  | int | n )

Definition at line 1916 of file shared.cc.

: SharedObject(), nthreads(n) {
scheduler = sched;
acquireShared(sched);
}
LibThread::SharedObject::SharedObject
SharedObject()
Definition shared.cc:156
LibThread::ThreadPool::nthreads
int nthreads
Definition shared.cc:1631
LibThread::ThreadPool::scheduler
Scheduler * scheduler
Definition shared.cc:1630
LibThread::acquireShared
void acquireShared(SharedObject *obj)
Definition shared.cc:188

## ThreadPool() [2/2]

LibThread::ThreadPool::ThreadPool | ( | int | n | ) |

Definition at line 1912 of file shared.cc.

: SharedObject(), nthreads(n) {
scheduler = new Scheduler(n);
acquireShared(scheduler);
}

## ~ThreadPool()

LibThread::ThreadPool::~ThreadPool | ( |  | ) |

Definition at line 1920 of file shared.cc.

{
releaseShared(scheduler);
}
LibThread::releaseShared
void releaseShared(SharedObject *obj)
Definition shared.cc:192

## Member Function Documentation

## addThread()

void LibThread::ThreadPool::addThread | ( | ThreadState * | thread | ) |

Definition at line 1925 of file shared.cc.

{
scheduler->addThread(this, thread);
}

## attachJob()

void LibThread::ThreadPool::attachJob | ( | Job * | job | ) |

Definition at line 1928 of file shared.cc.

{
scheduler->attachJob(this, job);
}

## broadcastJob()

void LibThread::ThreadPool::broadcastJob | ( | Job * | job | ) |

Definition at line 1937 of file shared.cc.

{
scheduler->broadcastJob(this, job);
}

## cancelDeps()

void LibThread::ThreadPool::cancelDeps | ( | Job * | job | ) |

Definition at line 1940 of file shared.cc.

{
scheduler->cancelDeps(job);
}

## cancelJob()

void LibThread::ThreadPool::cancelJob | ( | Job * | job | ) |

Definition at line 1943 of file shared.cc.

{
scheduler->cancelJob(job);
}

## clearThreadState()

void LibThread::ThreadPool::clearThreadState | ( |  | ) |

Definition at line 1949 of file shared.cc.

{
scheduler->clearThreadState();
}

## detachJob()

void LibThread::ThreadPool::detachJob | ( | Job * | job | ) |

Definition at line 1931 of file shared.cc.

{
scheduler->detachJob(job);
}

## getThread()

ThreadState * LibThread::ThreadPool::getThread | ( | int | i | ) |

Definition at line 1923 of file shared.cc.

{ return scheduler->getThread(i); }
i
int i
Definition cfEzgcd.cc:132

## queueJob()

void LibThread::ThreadPool::queueJob | ( | Job * | job | ) |

Definition at line 1934 of file shared.cc.

{
scheduler->queueJob(job);
}

## shutdown()

void LibThread::ThreadPool::shutdown | ( | bool | wait | ) |

Definition at line 1924 of file shared.cc.

{ scheduler->shutdown(wait); }
wait
wait
Definition si_signals.h:61

## waitJob()

void LibThread::ThreadPool::waitJob | ( | Job * | job | ) |

Definition at line 1946 of file shared.cc.

{
scheduler->waitJob(job);
}

## Field Documentation

## nthreads

int LibThread::ThreadPool::nthreads

Definition at line 1631 of file shared.cc.

## scheduler

Scheduler* LibThread::ThreadPool::scheduler

Definition at line 1630 of file shared.cc.

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

- Singular/dyn_modules/systhreads/shared.cc