views:

318

answers:

5
+3  Q: 

Java Thread Pool

I want to learn to write a thread pool in Java

Can anyone point me to useful resources ?

+1  A: 

This is the best resource I've ever found for getting this kind of information.

JUST MY correct OPINION
+3  A: 

I definitely recommend reading "concurrency in practice". It's the number one book dealing with threading issues in Java.

amarillion
+1  A: 

You could have a look at the source code for ThreadPoolExecutor from core java. Though why do you want to reinvent the wheel?

beny23
+3  A: 

take a look at Doug Lea's books... they are fairly old now (unless he released a new one, not sure), but the concurrent package added in 1.5 is based on his threading libraries. as far as i am concerned, he is the authority on concurrent programming in java... his books will give you the basics of what you need to understand to accomplish this task.

i can only assume this is an academic exercise... if not, i would strongly recommend you stick to the concurrent package as it is well-tested and well-developed... don't re-invent the wheel. good luck.

PaulP1975
I strongly recommend this as well since Doug Lea was one of the primary developers that created the concurrency package in Java
Ascalonian
I agree with Ascalonian. I took Doug Lea's concurrency course at Oswego and it was one of the best classes I ever took. (Next to compiler, which he also taught.) The book he recommends right now is "Java Concurrency in Practice" as amarillion said.
Jeremy
I haven't read that book... can't really go wrong with a list of authors like that though! i just realized that Lea is listed on there... i didn't see it first time i looked.
PaulP1975