G
Guest
As shown below, the genetic algorithm is applied to consecutive objects
The next calculation should not begin until the previous calculation ends
However, without any code between ...., calculation thread is generated simulataneously
As I monitor ts(ThreadState), it maintains constantly 'Background, Unstarted' even in the end of the calculation
If I insert while loop the thread does not start
If I use Thread.IsAlive, it works good. It shows 'false' when the calculation is terminated
But, I have no idea to apply this property to my code without while loop
How can I do that? Is an event in need
foreach (object o in objects
Calculate calc = new Calculate(o)
Thread t = calc.
ThreadState ts = t.ThreadStat
...
calc.Start()
...
class Calculatio
public Thread T {get {return t;}
public void Start(
t = new Thread(new ThreadStart(Evolution))
t.IsBackground = true
t.Start()
// Genetic algorith
private void Evolution(
.............
}
The next calculation should not begin until the previous calculation ends
However, without any code between ...., calculation thread is generated simulataneously
As I monitor ts(ThreadState), it maintains constantly 'Background, Unstarted' even in the end of the calculation
If I insert while loop the thread does not start
If I use Thread.IsAlive, it works good. It shows 'false' when the calculation is terminated
But, I have no idea to apply this property to my code without while loop
How can I do that? Is an event in need
foreach (object o in objects
Calculate calc = new Calculate(o)
Thread t = calc.
ThreadState ts = t.ThreadStat
...
calc.Start()
...
class Calculatio
public Thread T {get {return t;}
public void Start(
t = new Thread(new ThreadStart(Evolution))
t.IsBackground = true
t.Start()
// Genetic algorith
private void Evolution(
.............
}