view src/alice/test/dpp/codesegment/StartCodeSegment.java @ 20:6018e62cb198 dead lock dpp

modified
author one
date Sun, 09 Dec 2012 23:09:04 +0900
parents 33727db069c2
children
line wrap: on
line source

package alice.test.dpp.codesegment;

import alice.codesegment.CodeSegment;
import alice.test.dpp.datasegment.Fork;
import alice.test.dpp.datasegment.Philosophy;

public class StartCodeSegment extends CodeSegment {

	@Override
	public void run() {
		System.out.println("run StartCodeSegment");
		
		new ScheduleCodeSegment("phil1");
		new ScheduleCodeSegment("phil2");
		new ScheduleCodeSegment("phil3");
		
		ods.update("local", "phil1", new Philosophy("phil1","fork1","fork2"));
		ods.update("local", "phil2", new Philosophy("phil2","fork2","fork3"));
		ods.update("local", "phil3", new Philosophy("phil3","fork3","fork1"));
		ods.update("local", "fork1", new Fork("fork1"));
		ods.update("local", "fork2", new Fork("fork2"));
		ods.update("local", "fork3", new Fork("fork3"));

	}

}