Re: How to wait for thread?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Brett,

Well, you mentioned it yourself. You are on a single cpu. Because of
this, the tasks are all sharing the CPU. Each thread will get a slice of
CPU time.

Using threads doesn't guarantee that your program will run faster. Even
if you had a multi-cpu system, it isn't guaranteed. You could have slower
performance due to context switches, for example.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Brett Romero" <account@xxxxxxxxx> wrote in message
news:1155083104.032067.308330@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks. That seems to be working fine. I'm running different task on
each thread. It is taking the same amount of time as if I were doing
everything on the same thread. Here's what I'm doing in the
LoadObjects class:

thrd1 = new Thread( delegate( )
{
//do something here
} );

...and so on for the others

Why would it take the same amount of time? This is a single cpu (Intel
Pentium D 2.8Ghz) WinXP box.

Thanks,
Brett



.