Top Posters
Since Sunday
z
4
n
4
t
4
k
3
x
3
r
3
m
3
j
3
c
3
l
3
e
3
s
2
New Topic  
Crystalboo92 Crystalboo92
wrote...
Posts: 545
4 years ago
Suppose there are three Runnable tasks, task1, task2, task3. How do you run them in a thread pool with 2 fixed threads?

▸ ExecutorService executor = Executors.newFixedThreadPool(1); executor.execute(task1); executor.execute(task2); executor.execute(task3);

▸ ExecutorService executor = Executors.newFixedThreadPool(2); executor.execute(task1); executor.execute(task2); executor.execute(task3);

▸ ExecutorService executor = Executors.newFixedThreadPool(3); executor.execute(task1); executor.execute(task2); executor.execute(task3);

▸ new Thread(task1).start(); new Thread(task2).start(); new Thread(task3).start();
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 41 times
1 Reply
Replies
Answer verified by a subject expert
jrhome1985!jrhome1985!
wrote...
Posts: 375
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here
1

Related Topics

Crystalboo92 Author
wrote...

4 years ago
Correct Slight Smile TY
wrote...

Yesterday
Smart ... Thanks!
wrote...

2 hours ago
This calls for a celebration Person Raising Both Hands in Celebration
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  598 People Browsing
Related Images
  
 261
  
 1645
  
 186
Your Opinion
Which of the following is the best resource to supplement your studies:
Votes: 365