Package threads

Examples of threads.Task


//        System.out.println(func);

    }

    static void nonThread() {
        Task task = new Task();
        task.count = 100;
        for (int index = 0; index < task.count; index++) {
            Function log = new Log(1 + random() * 9);
            task.func = log;
            task.leftBorder = random() * 100;
 
View Full Code Here


            System.out.println("Result " + task.leftBorder + " " + task.rightBorder + " " + task.delta + " " + x);
        }
    }

    static void simpleThreads() {
        Task task = new Task();
        task.func = new Log(1 + random() * 9);
        task.leftBorder = random() * 100;
        task.rightBorder = random() * 100 + 100;
        task.delta = random();
        task.count = 100;
View Full Code Here

        System.out.println("Complicated");
        complicatedThreads();
    }

    static void nonThread() {
        Task task = new Task();
        task.count = 100;
        for (int index = 0; index < task.count; index++) {
            Function log = new Log(1 + random() * 9);
            task.func = log;
            task.leftBorder = random() * 100;
 
View Full Code Here

            System.out.println("Result " + task.leftBorder + " " + task.rightBorder + " " + task.delta + " " + x);
        }
    }

    static void simpleThreads() {
        Task task = new Task();
        task.func = new Log(1 + random() * 9);
        task.leftBorder = random() * 100;
        task.rightBorder = random() * 100 + 100;
        task.delta = random();
        task.count = 100;
View Full Code Here

        generatorThread.start();
        integratorThread.start();
    }

    static void complicatedThreads() {
        Task task = new Task();
        task.count = 100;
        Semaphore semaphore = new Semaphore();
        Thread generatorThread = new Generator(task, semaphore, "Generator");
        //generatorThread.setPriority(Thread.MAX_PRIORITY);
        Thread integratorThread = new Integrator(task, semaphore, "Integrator");
View Full Code Here

        generatorThread.start();
        integratorThread.start();
    }

    static void complicatedThreads() {
        Task task = new Task();
        task.count = 100;
        Semaphore semaphore = new Semaphore();
        Thread generatorThread = new Generator(task, semaphore, "Generator");
        //generatorThread.setPriority(Thread.MAX_PRIORITY);
        Thread integratorThread = new Integrator(task, semaphore, "Integrator");
View Full Code Here

TOP

Related Classes of threads.Task

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.