g*****g 发帖数: 34805 | 1 Executors.newFixedThreadPool(1);
class PrintTask extends Callable {
public PrintTask(DeviceEnum device, int printTime);
}
record current timestamp and use finish time to come up with statistics is
enough.
Not rocket science. |
|
b**********5 发帖数: 7881 | 2 ? So i am assuming it will be a queue of PrintTask u defined above.
So are u saying i should start 3 producer threads for 3 devices? But if u
already include device enum in the printtask, then why do u need 3 different
threads for each? |
|
b**********5 发帖数: 7881 | 3 now i am back to square one... if u not gonna have any producer thread, then
how is the queue of PrintTasks getting added? |
|
g*****g 发帖数: 34805 | 4 For simulation,you just need to demonstrate the ability submit each task
asynchronously. That's why each task is a callable future.
e.g.
Future f = threadpool.submit(new PrintTask(USB, 10));
different |
|