由买买提看人间百态

topics

全部话题 - 话题: printtask
(共0页)
g*****g
发帖数: 34805
1
来自主题: JobHunting版 - 这题怎么做?
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
来自主题: JobHunting版 - 这题怎么做?
? 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
来自主题: JobHunting版 - 这题怎么做?
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
来自主题: JobHunting版 - 这题怎么做?
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
(共0页)