Click here to Skip to main content
15,894,646 members
Home / Discussions / C#
   

C#

 
QuestionRe: System.StackOverflowException was unhandled Pin
cuongmits21-Apr-08 7:36
cuongmits21-Apr-08 7:36 
GeneralRe: System.StackOverflowException was unhandled Pin
Yusuf21-Apr-08 8:21
Yusuf21-Apr-08 8:21 
QuestionRe: System.StackOverflowException was unhandled Pin
cuongmits21-Apr-08 20:27
cuongmits21-Apr-08 20:27 
GeneralRe: System.StackOverflowException was unhandled Pin
Yusuf22-Apr-08 1:35
Yusuf22-Apr-08 1:35 
GeneralMulti threading To my Search Program Pin
shinboxe21-Apr-08 1:39
shinboxe21-Apr-08 1:39 
GeneralRe: Multi threading To my Search Program Pin
J4amieC21-Apr-08 2:15
J4amieC21-Apr-08 2:15 
GeneralRe: Multi threading To my Search Program Pin
shinboxe21-Apr-08 3:35
shinboxe21-Apr-08 3:35 
GeneralRe: Multi threading To my Search Program Pin
Simon P Stevens21-Apr-08 3:35
Simon P Stevens21-Apr-08 3:35 
Multi threading isn't a simple solution to all your performance problems. You're accessing a disk here, and looping through every file and directory. Disk access is slow compared to CPU speeds. if you spawn multiple threads, all that's going to happen is they'll each be fighting over the disk because the disk won't be able to keep up with all the requests from the CPU.

It's like copying files. Try copying 2 large files separately, but start them at the same time. See how long it takes. Now try copying them one at a time and wait for the first to finish before you start the second, it'll take roughly the same amount of time in total, because by doing them both at the same all that happens is the CPU has to wait for the disk to be ready.

There is no easy way to speed up a full disk search, you've just got to sit it out. I suppose what you can do is have 1 thread for getting all the data from the disk, and a second to process it all, so thread 1 can carry on reading the disk while thread 2 is processing the data. But other than that, multi threading is not going to help you unless you have multiple disks, then you can target 1 thread at each disk.

(The other way to do things is to index the disk, and hold the index in memory. You would have to have a service or something to monitor the disk for changes. I assume this is how things like google desktop search works.)


Simon

GeneralRe: Multi threading To my Search Program Pin
shinboxe21-Apr-08 3:54
shinboxe21-Apr-08 3:54 
GeneralRe: Multi threading To my Search Program Pin
Simon P Stevens21-Apr-08 4:22
Simon P Stevens21-Apr-08 4:22 
GeneralRe: Multi threading To my Search Program Pin
shinboxe21-Apr-08 8:57
shinboxe21-Apr-08 8:57 
Questionhow to know that an internet connection is alive at some instant? Pin
ptr2void21-Apr-08 1:03
ptr2void21-Apr-08 1:03 
GeneralRe: how to know that an internet connection is alive at some instant? Pin
phannon8621-Apr-08 1:16
professionalphannon8621-Apr-08 1:16 
GeneralRe: how to know that an internet connection is alive at some instant? Pin
ptr2void21-Apr-08 1:25
ptr2void21-Apr-08 1:25 
GeneralRe: how to know that an internet connection is alive at some instant? Pin
Pete O'Hanlon21-Apr-08 1:44
mvePete O'Hanlon21-Apr-08 1:44 
GeneralRe: how to know that an internet connection is alive at some instant? Pin
ptr2void21-Apr-08 1:54
ptr2void21-Apr-08 1:54 
GeneralRe: how to know that an internet connection is alive at some instant? Pin
Pete O'Hanlon21-Apr-08 2:00
mvePete O'Hanlon21-Apr-08 2:00 
GeneralRe: how to know that an internet connection is alive at some instant? Pin
Mustafa Ismail Mustafa21-Apr-08 2:02
Mustafa Ismail Mustafa21-Apr-08 2:02 
GeneralRe: how to know that an internet connection is alive at some instant? Pin
J4amieC21-Apr-08 3:15
J4amieC21-Apr-08 3:15 
GeneralRe: how to know that an internet connection is alive at some instant? Pin
Mustafa Ismail Mustafa21-Apr-08 8:13
Mustafa Ismail Mustafa21-Apr-08 8:13 
Generalmake richtextbox transparent Pin
kamalesh574321-Apr-08 0:11
kamalesh574321-Apr-08 0:11 
GeneralRe: make richtextbox transparent Pin
Blue_Boy21-Apr-08 0:36
Blue_Boy21-Apr-08 0:36 
GeneralGet all tables in sql server instance Pin
hdv21220-Apr-08 23:57
hdv21220-Apr-08 23:57 
GeneralRe: Get all tables in sql server instance Pin
Mustafa Ismail Mustafa21-Apr-08 0:06
Mustafa Ismail Mustafa21-Apr-08 0:06 
GeneralRe: Get all tables in sql server instance Pin
Blue_Boy21-Apr-08 0:19
Blue_Boy21-Apr-08 0:19 

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.