All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kilim.examples.Group Maven / Gradle / Ivy

Go to download

Coroutines, continuations, fibers, actors and message passing for the JVM

There is a newer version: 2.0.2-jdk7
Show newest version
/* Copyright (c) 2006, Sriram Srinivasan
 *
 * You may distribute this software under the terms of the license 
 * specified in the file "License"
 */

package kilim.examples;

import kilim.Pausable;
import kilim.Task;
import kilim.TaskGroup;

public class Group {
    public static void main(String[] args) {
        TaskGroup tg = new TaskGroup();
        tg.add(new GroupTask().start());
        tg.add(new GroupTask().start());
        tg.joinb();
        System.exit(0);
    }
    
    static class GroupTask extends Task {
        public void execute() throws Pausable {
            System.out.println("Task #" + id + "sleeping");
            Task.sleep(1000);
            System.out.println("Task #" + id + "done");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy