Re: How to wait for thread?
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 8 Aug 2006 20:34:41 -0400
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
.
- Follow-Ups:
- Re: How to wait for thread?
- From: Brett Romero
- Re: How to wait for thread?
- References:
- How to wait for thread?
- From: Brett Romero
- Re: How to wait for thread?
- From: Carl Daniel [VC++ MVP]
- Re: How to wait for thread?
- From: Brett Romero
- How to wait for thread?
- Prev by Date: Re: How to wait for thread?
- Next by Date: Re: How to wait for thread?
- Previous by thread: Re: How to wait for thread?
- Next by thread: Re: How to wait for thread?
- Index(es):