HowTo: Java - Implement a simple Threadpool

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Hi,

just had a small doubt
should u need to call r.run() method or r.start() method at 9:17

naveenshankar
Автор

Hi Mori:
Just a small question, why using "While" in "While(taskQueue.isEmpty)", can I use if?

MrEugeneleo
Автор

Hi,
What is use of multi worker threads in ur example?

hiteshsaxena
Автор

How does the ThreadWorker class know what taskQueue is. I am getting a cannot find symbol error.

steve
Автор

It will put the Thread back in waiting state if it has been woken but there is no task available. It is true that that won't happen unless you change the notify() in enqueue() to notifyAll(), so handle this as you like.

RomiMori
Автор

Great work man! Easy and clear to understand!

nicklasnilsson
Автор

Just writing the code is not sufficient. You should show a full fledged working code with some output.

azim
Автор

Shouldn't we use "LinkedBlockingQueue" ?

rtheame
Автор

Before you preach others, you need to understand first. Non nonsensical video

sjlegends