This topic contains a solution. Click here to go to the answer

Author Question: Suppose there are three Runnable tasks, task1, task2, task3. How do you run them in a thread pool ... (Read 55 times)

kodithompson

  • Hero Member
  • *****
  • Posts: 566
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();


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by kodithompson on May 6, 2020

Jbrasil

  • Sr. Member
  • ****
  • Posts: 337
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 50% of students answer this correctly




kodithompson

  • Member
  • Posts: 566
Reply 2 on: May 6, 2020
Wow, this really help


nathang24

  • Member
  • Posts: 314
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

Green tea is able to stop the scent of garlic or onion from causing bad breath.

Did you know?

The newest statin drug, rosuvastatin, has been called a superstatin because it appears to reduce LDL cholesterol to a greater degree than the other approved statin drugs.

Did you know?

Patients who have been on total parenteral nutrition for more than a few days may need to have foods gradually reintroduced to give the digestive tract time to start working again.

Did you know?

Individuals are never “cured” of addictions. Instead, they learn how to manage their disease to lead healthy, balanced lives.

Did you know?

Autoimmune diseases occur when the immune system destroys its own healthy tissues. When this occurs, white blood cells cannot distinguish between pathogens and normal cells.

For a complete list of videos, visit our video library