Click here to Skip to main content
15,887,083 members
Home / Discussions / C#
   

C#

 
AnswerRe: Invoke a function every time that a function is been added to my event Pin
OriginalGriff30-Dec-09 2:01
mveOriginalGriff30-Dec-09 2:01 
AnswerRe: Invoke a function every time that a function is been added to my event Pin
petercrab30-Dec-09 16:56
petercrab30-Dec-09 16:56 
QuestionThreads, speed up calculations Pin
Renven30-Dec-09 1:01
Renven30-Dec-09 1:01 
AnswerRe: Threads, speed up calculations Pin
Rob Philpott30-Dec-09 1:17
Rob Philpott30-Dec-09 1:17 
GeneralRe: Threads, speed up calculations Pin
Renven30-Dec-09 1:31
Renven30-Dec-09 1:31 
AnswerRe: Threads, speed up calculations Pin
Luc Pattyn30-Dec-09 2:01
sitebuilderLuc Pattyn30-Dec-09 2:01 
AnswerCODE Pin
Renven30-Dec-09 2:22
Renven30-Dec-09 2:22 
GeneralRe: CODE Pin
Luc Pattyn30-Dec-09 3:00
sitebuilderLuc Pattyn30-Dec-09 3:00 
Some comments:

1.
please show code in PRE tags (e.g. use "code block" widget) for better readability

2.
your threads share the transfered[] array, i.e. they each fill one row. For performance, I would avoid 2-D arrays, give them each a 1-D array.

3.
you are abusing the var keyword; if color22 is a Color, then declare it a Color (for readability).

4.
as there are only a few iterations in the for loop, most time is spent inside RGBreturnLVL(). So one may want to see that code too.

5.
if threads do almost identical things, they don't need separate code; make a simple class that describes one threaded job, holding its code and data.

6.
if is not running on the main thread (the name seems to indicate so), then listBox1.Items.Add("7 THREAD = " + duration); is NOT allowed. See this article.[^]

7.
assuming there is no blocking system call (e.g. a file/network read) inside your threaded code, it does not make sense to have more calculation threads than there are CPUs. Threading overhead can make it slower.

8.
seems like maze[] is pretty constant, and only a few elements are needed here; I would copy them in local variables once, and use those all the time.

Smile | :)

Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Merry Christmas and a Happy New Year to all.


GeneralRe: CODE Pin
Renven30-Dec-09 3:27
Renven30-Dec-09 3:27 
GeneralRe: CODE Pin
Renven30-Dec-09 3:44
Renven30-Dec-09 3:44 
GeneralRe: CODE Pin
Luc Pattyn30-Dec-09 3:49
sitebuilderLuc Pattyn30-Dec-09 3:49 
GeneralRe: CODE Pin
harold aptroot30-Dec-09 3:49
harold aptroot30-Dec-09 3:49 
GeneralRe: CODE Pin
Daniel Grunwald30-Dec-09 3:50
Daniel Grunwald30-Dec-09 3:50 
GeneralRe: CODE Pin
Renven30-Dec-09 4:03
Renven30-Dec-09 4:03 
GeneralRe: CODE Pin
Luc Pattyn30-Dec-09 4:38
sitebuilderLuc Pattyn30-Dec-09 4:38 
GeneralRe: CODE Pin
Daniel Grunwald30-Dec-09 4:42
Daniel Grunwald30-Dec-09 4:42 
GeneralRe: CODE Pin
Luc Pattyn30-Dec-09 4:58
sitebuilderLuc Pattyn30-Dec-09 4:58 
AnswerRe: Threads, speed up calculations Pin
#realJSOP30-Dec-09 2:27
mve#realJSOP30-Dec-09 2:27 
GeneralRe: Threads, speed up calculations Pin
Ben Fair30-Dec-09 3:19
Ben Fair30-Dec-09 3:19 
GeneralRe: Threads, speed up calculations Pin
Renven30-Dec-09 4:05
Renven30-Dec-09 4:05 
QuestionIntegrate sql server's Query Editor Window with C# Project Pin
Dot-Net-Dev30-Dec-09 0:50
Dot-Net-Dev30-Dec-09 0:50 
AnswerRe: Integrate sql server's Query Editor Window with C# Project Pin
Eddy Vluggen30-Dec-09 4:03
professionalEddy Vluggen30-Dec-09 4:03 
Questionhow to make web application using multipoint sdk Pin
krunal2529-Dec-09 23:45
krunal2529-Dec-09 23:45 
AnswerRe: how to make web application using multipoint sdk Pin
Jimmanuel30-Dec-09 3:02
Jimmanuel30-Dec-09 3:02 
QuestionTreeview doesn't update after treenode.remove Pin
eyalle29-Dec-09 23:14
eyalle29-Dec-09 23:14 

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.