2 Topics

Member Avatar for
Member Avatar for nikolaos

ProducerConsumer_Using_ExecutorService class in a for loop initiate producer consumer threads using worker threads from ExecutorServiceThreadPool class. consumer thread takes an element from queue adding it to ArrayList consumerdata. Seems that consumerdata has no elements. why is that; Both producer - consumer threads seem to work. import java.util.ArrayList; import java.util.Iterator; public …

Member Avatar for nikolaos
0
4K
Member Avatar for _neo_

Hi folk. Can I use join() method in implementation of run(), like this: [CODE] public class MyThread extends Thread { @Override public void run() { int timeout = 30000; // here is some heavy work join(timeout); } } [/CODE] Is above thread terminated after timeout milliseconds if task takes longer …

Member Avatar for _neo_
0
292

The End.