40 #ifdef GECODE_HAS_THREADS 44 namespace Gecode {
namespace Search {
namespace Parallel {
110 engine().wait_terminate();
116 engine().ack_reset_start();
120 engine().ack_reset_stop();
130 }
else if (cur != NULL) {
138 switch (cur->status(*
this)) {
149 (void) cur->choice();
177 }
else if (!
path.empty()) {
unsigned int workers(void) const
Return number of workers.
Support::Event e_reset_ack_start
Event for reset acknowledgment started.
Space must be branched (at least one brancher left)
void terminate(void)
For engine to peform thread termination.
void rfree(void *p)
Free memory block starting at p.
virtual ~BAB(void)
Destructor.
Worker * worker(unsigned int i) const
Provide access to worker i.
void idle(void)
Report that worker is idle.
Statistics statistics(void)
Return statistics.
const unsigned int initial_delay
Initial delay in milliseconds for all but first worker thread.
virtual void reset(Space *s)
Reset engine to restart at space s.
void path(Home home, int offset, const IntVarArgs &x, IntVar s, IntVar e, IntPropLevel ipl)
Post propagator such that x forms a Hamiltonian path.
void acquire(void)
Acquire the mutex and possibly block.
void stop(void)
Report that worker has been stopped.
Space * clone(bool share_data=true, bool share_info=true, CloneStatistics &stat=unused_clone) const
Clone space.
void * mark(void *p)
Return marked pointer for unmarked pointer p.
void block(void)
Block all workers.
const Options & opt(void) const
Provide access to search options.
void better(Space *b)
Accept better solution b.
volatile unsigned int n_busy
Number of busy workers.
void release(void)
Release the mutex.
Gecode::FloatVal c(-8, 8)
Gecode::IntArgs i(4, 1, 2, 3, 4)
Support::Mutex m_wait_reset
Mutex for waiting for reset.
virtual void constrain(const Space &b)
Constrain future solutions to be better than b.
virtual Statistics statistics(void) const
Return statistics.
const unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
static void sleep(unsigned int ms)
Put current thread to sleep for ms milliseconds.
virtual void constrain(const Space &best)
Constrain function for best solution search.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
virtual ~Worker(void)
Destructor.
virtual NoGoods & nogoods(void)
Constrain Return no-goods.
Choice for performing commit
No-goods recorded from restarts.
void release(Cmd c)
Release all workers.
Heap heap
The single global heap.
SpaceStatus status(StatusStatistics &stat=unused_status)
Query space status.
const unsigned int c_d
Create a clone after every c_d commits (commit distance)
void reset(Space *s, unsigned int ngdl)
Reset engine to restart at space s.
Gecode toplevel namespace
const unsigned int nogoods_limit
Depth limit for no-good generation during search.
Worker ** _worker
Array of worker references.
Space * best
Best solution so far.
virtual void run(void)
Start execution of worker.
NoGoods & nogoods(void)
Return no-goods.
#define GECODE_NEVER
Assert that this command is never executed.
void wait(void)
Wait until the event becomes signalled.
Support::Event e_reset_ack_stop
Event for reset acknowledgment stopped.
Cmd cmd(void) const
Return current command.
Space is solved (no brancher left)
Support::Mutex m_search
Mutex for search.