Example usage for java.lang Runnable interface-usage

List of usage examples for java.lang Runnable interface-usage

Introduction

In this page you can find the example usage for java.lang Runnable interface-usage.

Usage

From source file Main.java

class ThreadDemo implements Runnable {

    ThreadDemo() {

        Thread t = new Thread(this);
        t.start();

From source file Main.java

public class Main implements Runnable {
    static int NUM_THREADS = 25;
    CountDownLatch cdl1 = new CountDownLatch(NUM_THREADS);
    int myValue = 0;
    AtomicInteger count = new AtomicInteger(0);

From source file Main.java

public class Main implements Runnable {
    public void run() {
        System.out.println("produces " + idSequence.incrementAndGet());
    }

    public static void main(String[] args) {

From source file Main.java

class ThreadGroupDemo implements Runnable {
    public ThreadGroupDemo() {
        ThreadGroup pGroup = new ThreadGroup("Parent ThreadGroup");

        ThreadGroup cGroup = new ThreadGroup(pGroup, "Child ThreadGroup");

From source file RunnableTask.java

class RunnableTask implements Runnable {
    private int taskId;
    private int loopCounter;

    public RunnableTask(int taskId, int loopCounter) {
        this.taskId = taskId;

From source file Main.java

class ThreadGroupDemo implements Runnable {
    public ThreadGroupDemo() {

        ThreadGroup pGroup = new ThreadGroup("Parent ThreadGroup");
        pGroup.setDaemon(true);

From source file Main.java

public class Main implements Runnable {

    public static void main(String[] args) throws InterruptedException {
        Main task = new Main();
        int threads = Runtime.getRuntime().availableProcessors();
        ExecutorService pool = Executors.newFixedThreadPool(threads);

From source file PrepareProduction.java

class PrepareProduction implements Runnable {
    private final List<String> queue;

    PrepareProduction(List<String> q) {
        queue = q;
    }

From source file Main.java

class ThreadGroupDemo implements Runnable {
    public ThreadGroupDemo() {

        ThreadGroup pGroup = new ThreadGroup("Parent ThreadGroup");
        pGroup.setMaxPriority(Thread.MAX_PRIORITY - 2);

From source file Main.java

class ThreadGroupDemo implements Runnable {
    public ThreadGroupDemo() {
        ThreadGroup pGroup = new ThreadGroup("Parent ThreadGroup");

        ThreadGroup cGroup = new ThreadGroup(pGroup, "Child ThreadGroup");