Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've done very little with threading and i mean very little. From my initial reading i can see the advantage to freeing up the app to do other things while a particularly long process is running.

 

However, in a single cpu environment there wouldn't be any kind of performance gain with the implementation of threading correct???

 

for example if i have

 

job1

job2

job3

 

the amount of time it would take for jobs 1-3 to complete would be the same if i ran them sequentially or spun them off into three different threads???

 

if it matters, can't imagine that it would, all jobs do bascially the same thing getdata(), changedata(), senddata()

  • Administrators
Posted

On a single CPU the overheads of thread management might even cause a (very very) slight performance drop - probably not large enough to worry about though.

 

However it's not just the overall time that you need to consider but also the user's perception.

 

If job1 was to take 5 minutes and effectively hung the UI while it was working (no repaints, (not responding) in the titlebar etc.) then it gives a poor impression. Running the activity in a 2nd thread would at least keep the main UI responsive and give a better overall impression.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

  • Leaders
Posted

Another place multi-threading might help: suppose you were to download a file and perform some other additional operation. A file download isn't particularly CPU intensive, which means that you can use two threads to use all that extra CPU power and do both at once instead of waiting for the download to finish.

 

Also, in the event that a user has a pentium with hyperthreading, theoretically an operation may perform faster if done using multiple threads, but I certainly wouldn't base a program around that.

[sIGPIC]e[/sIGPIC]
Posted

thanks for the input. i'm definetly going to use threading because there are a couple of places where i have to free up the app to do other things.

 

so i guess 100 one second jobs are going to take 100 seconds.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...