Click here to Skip to main content
14,868,965 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 22:39
MemberJaiprakash 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
MemberJaiprakash 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
MemberPlayByTheRules25-Apr-07 22:33 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 22:36
MemberJaiprakash M Bankolli25-Apr-07 22:36 
GeneralRe: Path class in .NET Pin
Andy *M*25-Apr-07 22:49
MemberAndy *M*25-Apr-07 22:49 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 22:58
MemberJaiprakash M Bankolli25-Apr-07 22:58 
GeneralRe: Path class in .NET Pin
Andy *M*25-Apr-07 23:02
MemberAndy *M*25-Apr-07 23:02 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 23:09
MemberJaiprakash M Bankolli25-Apr-07 23:09 
GeneralRe: Path class in .NET Pin
Andy *M*25-Apr-07 23:25
MemberAndy *M*25-Apr-07 23:25 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli25-Apr-07 23:33
MemberJaiprakash M Bankolli25-Apr-07 23:33 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 0:12
MemberAndy *M*26-Apr-07 0:12 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli26-Apr-07 2:17
MemberJaiprakash M Bankolli26-Apr-07 2:17 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 2:23
MemberAndy *M*26-Apr-07 2:23 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli26-Apr-07 2:27
MemberJaiprakash M Bankolli26-Apr-07 2:27 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 2:37
MemberAndy *M*26-Apr-07 2:37 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli26-Apr-07 2:45
MemberJaiprakash M Bankolli26-Apr-07 2:45 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 2:59
MemberAndy *M*26-Apr-07 2:59 
GeneralRe: Path class in .NET [modified] Pin
Jaiprakash M Bankolli26-Apr-07 3:04
MemberJaiprakash M Bankolli26-Apr-07 3:04 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 3:17
MemberAndy *M*26-Apr-07 3:17 
QuestionMultithreading-Performance Pin
roddy189124-Apr-07 20:21
Memberroddy189124-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
MemberBalagurunathan S24-Apr-07 19:41 
AnswerRe: what is satellite assembly..? Pin
MatrixCoder24-Apr-07 19:49
MemberMatrixCoder24-Apr-07 19:49 
GeneralRe: what is satellite assembly..? Pin
Balagurunathan S24-Apr-07 22:04
MemberBalagurunathan S24-Apr-07 22:04 

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.