Click here to Skip to main content
15,920,602 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 22:29
Jaiprakash M Bankolli25-Apr-07 22:29 
GeneralRe: Path class in .NET Pin
Pete O'Hanlon25-Apr-07 22:35
mvePete O'Hanlon25-Apr-07 22:35 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 22:39
Jaiprakash M Bankolli25-Apr-07 22:39 
GeneralRe: Path class in .NET Pin
Pete O'Hanlon25-Apr-07 22:48
mvePete O'Hanlon25-Apr-07 22:48 
GeneralRe: Path class in .NET [modified] Pin
Jaiprakash M Bankolli25-Apr-07 23:00
Jaiprakash M Bankolli25-Apr-07 23:00 
GeneralRe: Path class in .NET Pin
Dave Kreskowiak26-Apr-07 6:53
mveDave Kreskowiak26-Apr-07 6:53 
GeneralRe: Path class in .NET Pin
PlayByTheRules25-Apr-07 22:33
PlayByTheRules25-Apr-07 22:33 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 22:36
Jaiprakash M Bankolli25-Apr-07 22:36 
GeneralRe: Path class in .NET Pin
Andy *M*25-Apr-07 22:49
Andy *M*25-Apr-07 22:49 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 22:58
Jaiprakash M Bankolli25-Apr-07 22:58 
GeneralRe: Path class in .NET Pin
Andy *M*25-Apr-07 23:02
Andy *M*25-Apr-07 23:02 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 23:09
Jaiprakash M Bankolli25-Apr-07 23:09 
GeneralRe: Path class in .NET Pin
Andy *M*25-Apr-07 23:25
Andy *M*25-Apr-07 23:25 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 23:33
Jaiprakash M Bankolli25-Apr-07 23:33 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 0:12
Andy *M*26-Apr-07 0:12 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli26-Apr-07 2:17
Jaiprakash M Bankolli26-Apr-07 2:17 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 2:23
Andy *M*26-Apr-07 2:23 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli26-Apr-07 2:27
Jaiprakash M Bankolli26-Apr-07 2:27 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 2:37
Andy *M*26-Apr-07 2:37 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli26-Apr-07 2:45
Jaiprakash M Bankolli26-Apr-07 2:45 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 2:59
Andy *M*26-Apr-07 2:59 
GeneralRe: Path class in .NET [modified] Pin
Jaiprakash M Bankolli26-Apr-07 3:04
Jaiprakash M Bankolli26-Apr-07 3:04 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 3:17
Andy *M*26-Apr-07 3:17 
QuestionMultithreading-Performance Pin
roddy189124-Apr-07 20:21
roddy189124-Apr-07 20:21 
Hello!

I've got a problem with multithreading.

One should think that every Thread-Model causes overhead and is responsible
for a little bit lost of performance on a singel-Core CPU!
In my Case, the sequentiell version is about 3 % slower than the Threading-versions.
Has anybody an explanation for this?


//the worker-function
public void Function()
{
for (int i = 0; i < 10000; i++)
{
for (int j = 0; j < 10000; j++)
{
j = j + 1;
j = j - 1;
}
}
}

//Needed to set the AutoResetEvent -> Overhead?
public void FunctionNT(Object obj)
{
Function();
Object tmp = obj;
if (tmp != null)
{
((AutoResetEvent)obj).Set();
}
}

// sequentiell Version
class SequentiellTest : ThreadingParent
{
public SequentiellTest(int piterations)
{
this.iterations = piterations;
}

public void Run()
{
Worker wrk = new Worker();

for (int i = 0; i < iterations; i++)
{
wrk.Function();
}
}
}


// Version newThread
class NewThreadTest : ThreadingParent
{

public NewThreadTest(int piterations)
{
this.iterations = piterations;
}

public void Run()
{
AutoResetEvent[] ready = new AutoResetEvent[iterations];// = new AutoResetEvent(false);

Worker wrk = new Worker();

Thread[] tda = new Thread[iterations];

for (int i = 0; i < iterations; i++)
{
ready[i] = new AutoResetEvent(false);
tda[i] = new Thread(wrk.FunctionNT);
tda[i].Start(ready[i]);
}

//wait until all Threads are Ready
for (int j = 0; j < iterations; j++)
{
ready[j].WaitOne();
}
}
}


// Example for a Calling-Function
private void NewThreadStart()
{
//start the Stopwatch
stp.Start();

//Init NewThreadClass
NewThreadTest ntt = new NewThreadTest(Convert.ToInt16(tbIterations.Text));
ntt.Run();

//Stop the Stopwatch
stp.Stop();
}

Questionwhat is satellite assembly..? Pin
Balagurunathan S24-Apr-07 19:41
Balagurunathan S24-Apr-07 19:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.