Click here to Skip to main content
14,771,613 members
Home » Discussions » .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 3:23
MemberAndy *M*26-Apr-07 3:23 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli26-Apr-07 3:27
MemberJaiprakash M Bankolli26-Apr-07 3:27 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 3:37
MemberAndy *M*26-Apr-07 3:37 
GeneralRe: Path class in .NET Pin
Jaiprakash M Bankolli26-Apr-07 3:45
MemberJaiprakash M Bankolli26-Apr-07 3:45 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 3:59
MemberAndy *M*26-Apr-07 3:59 
GeneralRe: Path class in .NET [modified] Pin
Jaiprakash M Bankolli26-Apr-07 4:04
MemberJaiprakash M Bankolli26-Apr-07 4:04 
GeneralRe: Path class in .NET Pin
Andy *M*26-Apr-07 4:17
MemberAndy *M*26-Apr-07 4:17 
QuestionMultithreading-Performance Pin
roddy189124-Apr-07 21:21
Memberroddy189124-Apr-07 21: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 20:41
MemberBalagurunathan S24-Apr-07 20:41 
AnswerRe: what is satellite assembly..? Pin
MatrixCoder24-Apr-07 20:49
MemberMatrixCoder24-Apr-07 20:49 
GeneralRe: what is satellite assembly..? Pin
Balagurunathan S24-Apr-07 23:04
MemberBalagurunathan S24-Apr-07 23:04 
GeneralRe: what is satellite assembly..? Pin
szukuro25-Apr-07 0:15
Memberszukuro25-Apr-07 0:15 
AnswerRe: what is satellite assembly..? Pin
Jaiprakash M Bankolli25-Apr-07 0:15
MemberJaiprakash M Bankolli25-Apr-07 0:15 
Questionsealed UI classes Pin
DotNetInterest24-Apr-07 8:08
MemberDotNetInterest24-Apr-07 8:08 
AnswerRe: sealed UI classes Pin
Pete O'Hanlon24-Apr-07 10:54
mvePete O'Hanlon24-Apr-07 10:54 
AnswerRe: sealed UI classes [modified] Pin
Jaiprakash M Bankolli26-Apr-07 0:05
MemberJaiprakash M Bankolli26-Apr-07 0:05 
Question[Interop] Connectionpoint Advise hangs Pin
Sohailk24-Apr-07 7:57
MemberSohailk24-Apr-07 7:57 
QuestionWhy no GC.Kill(object)? Pin
Tristan Rhodes24-Apr-07 6:36
MemberTristan Rhodes24-Apr-07 6:36 
AnswerRe: Why no GC.Kill(object)? Pin
Colin Angus Mackay24-Apr-07 6:40
MemberColin Angus Mackay24-Apr-07 6:40 
GeneralRe: Why no GC.Kill(object)? Pin
Tristan Rhodes24-Apr-07 6:57
MemberTristan Rhodes24-Apr-07 6:57 
GeneralRe: Why no GC.Kill(object)? Pin
Dave Kreskowiak24-Apr-07 7:21
mveDave Kreskowiak24-Apr-07 7:21 
GeneralRe: Why no GC.Kill(object)? Pin
Tristan Rhodes24-Apr-07 8:07
MemberTristan Rhodes24-Apr-07 8:07 
AnswerRe: Why no GC.Kill(object)? Pin
Daniel Turini24-Apr-07 7:44
MemberDaniel Turini24-Apr-07 7:44 
Question.NET on linux/unix Pin
Waskira23-Apr-07 23:30
MemberWaskira23-Apr-07 23:30 
AnswerRe: .NET on linux/unix Pin
Tristan Rhodes24-Apr-07 4:51
MemberTristan Rhodes24-Apr-07 4:51 

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.