Click here to Skip to main content
16,005,162 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Running New Processes on a Remote Computer with Output Pin
Johan Hakkesteegt9-May-10 21:55
Johan Hakkesteegt9-May-10 21:55 
Questiongetting complete name of account NT server Pin
sal216-May-10 10:00
sal216-May-10 10:00 
AnswerRe: getting complete name of account NT server Pin
Stinebaugh6-May-10 16:30
Stinebaugh6-May-10 16:30 
GeneralRe: getting complete name of account NT server Pin
sal216-May-10 20:33
sal216-May-10 20:33 
GeneralRe: getting complete name of account NT server Pin
Stinebaugh7-May-10 6:22
Stinebaugh7-May-10 6:22 
GeneralRe: getting complete name of account NT server Pin
sal217-May-10 11:56
sal217-May-10 11:56 
QuestionMultithreading slower? [modified] Pin
NikWing6-May-10 5:36
NikWing6-May-10 5:36 
AnswerRe: Multithreading slower? Pin
Luc Pattyn6-May-10 5:52
sitebuilderLuc Pattyn6-May-10 5:52 
This is not uncommon. Adding one or a few threads is fine when the operation is compute-bound and you have a multi-core, so a single thread would leave all but one cores unused. Adding threads however increases the load on all subsystems (disk, main memory, cache memory, buses, ...) and adds a small overhead too, as you now need more stacks, some synchronization, and of course some thread switching. So it is conceivable you just go from one bottleneck to another, and while doing so, the cache efficiency may go down (a phenomenon known as 'cache trashing').

I just performed a little Parallel.For experiment myself the other day, and, while I must admit it was very I/O bound, it ran 5 times slower on a dual-core than the straightforward single-thread implementation.

However switching from 1 to 2 threads, I would not expect calculating file hashes would actually slow down, well not on a normal system, with a typical disk (I am assuming your files are on a local disk, not a network disk, not a USB stick). So there always is the possibility you did something wrong, maybe you are forcing a synchronization somehow, I would need to see the code to tell for sure.

Some implementation questions would be:
are you reading the entire file to memory, or are you streaming the data?
are you using new buffers all the time, or reusing them?

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.


GeneralRe: Multithreading slower? Pin
NikWing6-May-10 6:33
NikWing6-May-10 6:33 
GeneralRe: Multithreading slower? Pin
Luc Pattyn6-May-10 7:00
sitebuilderLuc Pattyn6-May-10 7:00 
GeneralRe: Multithreading slower? Pin
NikWing6-May-10 7:45
NikWing6-May-10 7:45 
GeneralRe: Multithreading slower? Pin
Luc Pattyn6-May-10 8:34
sitebuilderLuc Pattyn6-May-10 8:34 
GeneralRe: Multithreading slower? Pin
Luc Pattyn6-May-10 12:38
sitebuilderLuc Pattyn6-May-10 12:38 
GeneralRe: Multithreading slower? [modified] Pin
NikWing6-May-10 13:23
NikWing6-May-10 13:23 
General!!!DO NOT DUPLICATE CODE!!! Pin
Luc Pattyn6-May-10 13:37
sitebuilderLuc Pattyn6-May-10 13:37 
GeneralRe: !!!DO NOT DUPLICATE CODE!!! Pin
NikWing6-May-10 14:03
NikWing6-May-10 14:03 
GeneralRe: !!!DO NOT DUPLICATE CODE!!! Pin
Luc Pattyn6-May-10 14:12
sitebuilderLuc Pattyn6-May-10 14:12 
GeneralRe: !!!DO NOT DUPLICATE CODE!!! Pin
NikWing6-May-10 14:57
NikWing6-May-10 14:57 
GeneralRe: !!!DO NOT DUPLICATE CODE!!! Pin
Dave Kreskowiak6-May-10 16:57
mveDave Kreskowiak6-May-10 16:57 
GeneralRe: !!!DO NOT DUPLICATE CODE!!! Pin
NikWing7-May-10 0:43
NikWing7-May-10 0:43 
GeneralRe: Multithreading slower? Pin
Luc Pattyn6-May-10 13:57
sitebuilderLuc Pattyn6-May-10 13:57 
GeneralRe: Multithreading slower? Pin
NikWing6-May-10 14:21
NikWing6-May-10 14:21 
AnswerRe: Multithreading slower? Pin
Luc Pattyn6-May-10 6:14
sitebuilderLuc Pattyn6-May-10 6:14 
AnswerRe: Multithreading slower? Pin
supercat96-May-10 6:54
supercat96-May-10 6:54 
GeneralRe: Multithreading slower? Pin
NikWing6-May-10 7:56
NikWing6-May-10 7:56 

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.