Thread Pooling Design Question

Hi -

I am new to java and i have a task to complete using ThreadPooling. I am using JDK1.4 so i have decided to use the api provided by Doug Lea.

Basically i will have to process around 20000 documents daily which are in the database and each document has an ID associated and there is no dependency on each document. They can be processed independently.

I thought of using PooledExecutor to create a ThreadPool of lets say 5 and give the 4000 documents for each Thread to process them.

My confusion is how do i give 4000 documents to each thread making sure the same documents are not picked up by the other thread and will each thread return back to the pool after the task is done.

Should i use FutureResult object for these?

Any thoughts are really appreciated.

[809 byte] By [novicekumara] at [2007-11-27 7:06:22]
# 1
Any hints how to acheive this?Thanks
novicekumara at 2007-7-12 18:57:39 > top of Java-index,Core,Core APIs...
# 2
For my case last time which need to handle 1000 taks, I just simply create 1000 task (implements from Runnable) and submit to the fixed thread pool. It works fine for me. However, I am not sure about your case (40000)
KwangHooia at 2007-7-12 18:57:39 > top of Java-index,Core,Core APIs...
# 3
Thanks For your response. Appreciate if you could post me the sample of the code.
novicekumara at 2007-7-12 18:57:39 > top of Java-index,Core,Core APIs...