[galib] MultiThread + Functor

Guillaume Massé guillaume.masse at polymtl.ca
Wed May 19 14:25:19 EDT 2010

Hi all galibers,

I'm doing a modification of the galib that could be really useful for a new

First I wanted to re-implement population evaluation in a multithread way.
So i added the code to do so. But i realize quickly that this imply other
modification in the lib.

The evaluation function pointer is stored in a member of GAGenome called
Evaluator. Thus two thread could call that function at the same time
competing for any static memory. In my case it was even worst, the objective
function was implemented as a functor.

So to solve this problem I will implement a Evaluator base class. It will
have to implement operator()( GAGenome& g) and operator= to make copy. This
way each Genome of a Population will have is own Evaluator.

Guillaume Massé
École Polytechnique de Montréal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20100519/3d2c13a9/attachment.htm

More information about the galib mailing list