Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with threads synchronization?  RSS feed

kahina lallali
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,

Ive been trying to implement a double GA model (GA within a GA) using threads and I still can't figure out how to do the synchronization properly! At the moment, my code is:
The top GA runs and after initiliazation of the population and at the point of setting fitnesses, the second GA is called .I tried pausing the top GA so that it waits for the low level ones since it uses the same fitnesses, but that doesn't seem to happen...
There are conditional variables as well moving between the GAs for e.g. the xmosomes from the 1st GA need to be fed to the low level ones to calculate the fitnesses, which after completion of the low level GAs, they need to be returned to the top level GA.

Should I have a separate class altogether to manage the GAs? I'm not really sure how to go about it? New to Threads!

Any help & clarification would be very much appreciated!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!