Generated on for Gecode by doxygen 1.17.0

Simple threads. More...

#include <gecode/support/thread.hpp>

Classes

class  Run
 A real thread. More...

Static Public Member Functions

static Mutexm (void)
 Mutex for synchronization.
static void run (Runnable *r)
 Construct a new thread and run r.
static void sleep (unsigned int ms)
 Put current thread to sleep for ms milliseconds.
static unsigned int npu (void)
 Return number of processing units (1 if information not available).
static void acquireGlobalMutex (Mutex *m)
 acquire mutex m globally and possibly lock
static void releaseGlobalMutex (Mutex *m)
 release globally acquired mutex m

Static Public Attributes

static Runidle
 Idle runners.

Detailed Description

Simple threads.

Threads cannot be created, only runnable objects can be submitted for execution by a thread. Threads are pooled to avoid creation/destruction of threads as much as possible.

Definition at line 213 of file thread.hpp.

Member Function Documentation

◆ m()

Mutex * Gecode::Support::Thread::m ( void )
static

Mutex for synchronization.

◆ run()

void Gecode::Support::Thread::run ( Runnable * r)
inlinestatic

Construct a new thread and run r.

After r terminates, r is deleted. After that, the thread terminates.

If the operating system does not support any threads, throws an exception of type Support::OperatingSystemError.

Definition at line 177 of file thread.hpp.

◆ sleep()

void Gecode::Support::Thread::sleep ( unsigned int ms)
inlinestatic

Put current thread to sleep for ms milliseconds.

Definition at line 156 of file thread.hpp.

◆ npu()

unsigned int Gecode::Support::Thread::npu ( void )
inlinestatic

Return number of processing units (1 if information not available).

Definition at line 164 of file thread.hpp.

◆ acquireGlobalMutex()

void Gecode::Support::Thread::acquireGlobalMutex ( Mutex * m)
static

acquire mutex m globally and possibly lock

◆ releaseGlobalMutex()

void Gecode::Support::Thread::releaseGlobalMutex ( Mutex * m)
static

release globally acquired mutex m

Member Data Documentation

◆ idle

Run* Gecode::Support::Thread::idle
static

Idle runners.

Definition at line 238 of file thread.hpp.


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