Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

thread overhead

 
Peter Straw
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does starting and running many threads create a lot of overhead in terms of CPU and memory usage?
Say I am running 3 or 4 threads concurrently, each doing various database operations, is it the database operations that will create overhead or is it the fact that there are several threads running?
Many thanks.
 
Jon Strayer
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Peter Straw:
Does starting and running many threads create a lot of overhead in terms of CPU and memory usage?
Say I am running 3 or 4 threads concurrently, each doing various database operations, is it the database operations that will create overhead or is it the fact that there are several threads running?
Many thanks.

Yes. :-)
The only way to know for sure is to profile the application. My guess (and it's only a guess) is that the database operations will take far more time than the thread overhead.
But I can think of situations where that wouldn't be true.
 
Forget Steve. Look at this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!