• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to control number of threads

 
Sai Swami
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jolly Ranchers,

I have an app that reads from one db and stores in another db. there are 500000 records. i want multiple threads to do the reading and insertion.

how can i control the number of threads spawned? can anyone please throw some light on the design ?



thanks
~Sai
 
Henry Wong
author
Sheriff
Posts: 22524
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sai Swami wrote:Hi Jolly Ranchers,

I have an app that reads from one db and stores in another db. there are 500000 records. i want multiple threads to do the reading and insertion.

how can i control the number of threads spawned? can anyone please throw some light on the design ?

thanks
~Sai


Since you can spawn the threads with the Thread class -- I guess you can decide how many threads to spawn. As for getting the threads to exit, that is cooperative -- you'll have to code the threads to exit, when you want them to.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!