Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
AnswerRe: Geocoding Pin
Dave Kreskowiak20-May-09 2:11
mveDave Kreskowiak20-May-09 2:11 
QuestionMultithreading is faster? Pin
Quake2Player19-May-09 17:53
Quake2Player19-May-09 17:53 
AnswerRe: Multithreading is faster? Pin
mav.northwind19-May-09 18:43
mav.northwind19-May-09 18:43 
AnswerRe: Multithreading is faster? Pin
Luis Alonso Ramos19-May-09 18:52
Luis Alonso Ramos19-May-09 18:52 
AnswerRe: Multithreading is faster? Pin
Dave Kreskowiak20-May-09 2:14
mveDave Kreskowiak20-May-09 2:14 
AnswerRe: Multithreading is faster? Pin
Luc Pattyn20-May-09 2:58
sitebuilderLuc Pattyn20-May-09 2:58 
GeneralRe: Multithreading is faster? Pin
Quake2Player20-May-09 3:12
Quake2Player20-May-09 3:12 
GeneralRe: Multithreading is faster? Pin
Luc Pattyn20-May-09 3:40
sitebuilderLuc Pattyn20-May-09 3:40 
Yes, you are right to doubt the correctness of the answer given the simple but theoretical question.

if there is only a single core and there are no waits (which means no input/output, no disk accesses, and almost no user interface; not an average day-to-day situation) then threading won't help. In fact, without threading it will behave better because:
1) you don't have any threading overhead (order of milliseconds), so overall execution time would be slightly less
2) you get partial results sooner (whereas the interleaved execution will take longer to come up with something since it isn't focusing on a single part of the overall job)

There is one more aspect to the matter: "locality of reference"
Assume a lot of data needs to be handled, RAM memory being slow, and caches (level1 and leven2) being limited in size; then it is very favorable to perform all computations on a subset of the data (not exceeding level2 cache size), then move on to the next load of data, etc. One can hope to get this for free with multi-threading, but that only works well if all the jobs happen to proceed at the same pace (i.e. require the same number of instructions per amount of data). One would better organize for this, with multi-threading plus interthread synchronization, or, much simpler, a single thread and a loop that makes it happen.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

QuestionButtons appear differently in Vista than in XP (problem) Pin
sodevrom19-May-09 14:54
sodevrom19-May-09 14:54 
AnswerRe: Buttons appear differently in Vista than in XP (problem) Pin
Luis Alonso Ramos19-May-09 18:54
Luis Alonso Ramos19-May-09 18:54 
AnswerRe: Buttons appear differently in Vista than in XP (problem) Pin
saanj19-May-09 19:24
saanj19-May-09 19:24 
GeneralRe: Buttons appear differently in Vista than in XP (problem) Pin
sodevrom20-May-09 5:27
sodevrom20-May-09 5:27 
Questiondatagridview getting values Pin
sakis2419-May-09 13:21
sakis2419-May-09 13:21 
AnswerRe: datagridview getting values [modified] Pin
Christian Graus19-May-09 13:31
protectorChristian Graus19-May-09 13:31 
GeneralRe: datagridview getting values Pin
sakis2419-May-09 13:56
sakis2419-May-09 13:56 
GeneralRe: datagridview getting values Pin
sakis2419-May-09 14:21
sakis2419-May-09 14:21 
GeneralRe: datagridview getting values Pin
Mycroft Holmes19-May-09 14:34
professionalMycroft Holmes19-May-09 14:34 
GeneralRe: datagridview getting values Pin
sakis2419-May-09 14:50
sakis2419-May-09 14:50 
GeneralRe: datagridview getting values Pin
Mycroft Holmes19-May-09 15:38
professionalMycroft Holmes19-May-09 15:38 
QuestionDistributed Hosting Pin
Matt Cavanagh19-May-09 12:05
Matt Cavanagh19-May-09 12:05 
AnswerRe: Distributed Hosting Pin
Matty2219-May-09 15:48
Matty2219-May-09 15:48 
GeneralRe: Distributed Hosting Pin
Matt Cavanagh19-May-09 20:39
Matt Cavanagh19-May-09 20:39 
QuestionIs it possible to Convert from Windows Application to a Mobile Device Application? Pin
Star0919-May-09 11:35
Star0919-May-09 11:35 
AnswerRe: Is it possible to Convert from Windows Application to a Mobile Device Application? Pin
led mike19-May-09 11:55
led mike19-May-09 11:55 
GeneralRe: Is it possible to Convert from Windows Application to a Mobile Device Application? Pin
Star0919-May-09 11:57
Star0919-May-09 11:57 

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.