Skip to content

Instantly share code, notes, and snippets.

@tungurlakachakcak
Created February 3, 2020 09:01
Show Gist options
  • Save tungurlakachakcak/a41be62a50e3d907093781c34b9ee9d1 to your computer and use it in GitHub Desktop.
Save tungurlakachakcak/a41be62a50e3d907093781c34b9ee9d1 to your computer and use it in GitHub Desktop.
public class Main {
public static void main(String[] args) throws InterruptedException {
ITask summator1 = new Summator((byte) 90);
ITask summator2 = new Summator((byte) 9);
ITask summator3 = new Summator((byte) 30);
ITask summator4 = new Summator((byte) 65);
ITask summator5 = new Summator((byte) 100);
IThreadPool myThreadPool = new ThreadPool(4, 4);
myThreadPool.schedule(summator1);
myThreadPool.schedule(summator2);
myThreadPool.schedule(summator3);
myThreadPool.schedule(summator4);
myThreadPool.schedule(summator5);
Thread.sleep(1000);
myThreadPool.stop();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment