• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

how to control number of threads

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 23956
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic