58 static const int n_info = 8192;
75 std::atomic<unsigned int> npid;
88 double decay(
void)
const;
92 Info*
allocate(
unsigned int p,
unsigned int gid);
98 unsigned int pid(
void)
const;
113 GPI::Block::Block(
void)
114 : next(nullptr), free(n_info) {}
117 GPI::Block::rescale(
void) {
118 for (
int i=free; i < n_info; i++)
125 : b(&fst), invd(1.0), npid(0U), us(false) {}
130 c.afc = invd * (c.afc + 1.0);
132 for (Block* i = b; i !=
nullptr; i = i->next)
140 const_cast<GPI&
>(*this).m.acquire();
142 const_cast<GPI&
>(*this).m.release();
148 return npid.fetch_add(1, std::memory_order_seq_cst);
153 return npid.load(std::memory_order_acquire);
177 Block* n =
new Block;
180 c = &b->info[--b->free];
191 Block* n =
new Block;
194 c = &b->info[--b->free];
Base class for heap allocated objects.
Class for storing propagator information.
void init(unsigned int pid, unsigned int gid)
Initialize.
unsigned int pid
Propagator identifier.
unsigned int gid
Group identifier.
unsigned int pid(void) const
Return next free propagator id.
unsigned int next_pid(void)
Allocate a new propagator id without allocating information.
double decay(void) const
Return decay factor.
void fail(Info &c)
Increment failure count.
bool unshare(void)
Provide access to unshare info and set to true.
Info * allocate(unsigned int p, unsigned int gid)
Allocate info for existing propagator with pid p.
A mutex for mutual exclausion among several threads.
#define GECODE_KERNEL_EXPORT
const double rescale_limit
Rescale action and afc values when larger than this.
const double rescale
Rescale factor for action and afc values.
Gecode toplevel namespace