Checkpoint synchronization: Difference between revisions
Content deleted Content added
Line 342:
<lang Java>
import java.util.Scanner;
import
public class CheckpointSync{
Line 393:
private synchronized void work(){
try {
int workTime = rgen.nextInt(
System.out.println("Worker " + threadID + " will work for " + workTime + " msec.");
Thread.sleep(workTime); //work for 'workTime'
Line 425:
/* static variables */
private static
private static int nFinished = 0;
public static int nWorkers = 0;
|