comp.os.mswindows.programmer.win32
  Home FAQ Contact Sign in
comp.os.mswindows.programmer.win32 only
 
Advanced search
May 2007
motuwethfrsasuw
 123456 18
78910111213 19
14151617181920 20
21222324252627 21
28293031    22
2007
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007    
total
comp.os ... win32 Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Fast filesearching updating         


Author: janderson
Date: May 26, 2007 19:56

Hi gang,

I have a win32 C# app that needs to recursively search for a particular
file type really fast. It always searches the same place for these files.

I'm using Directory.GetDirectories and Directory.GetFiles to do it
currently. Because I know the location is the same every time I build a
cache of all the files and directories. If a directory changes I update
its contents on startup of the app.

Unfortunately when I do a last-date-of-modification check on a directory
it only reports on changes of files that are directly under it. So I
have to check every single directly rather then simply checking the
parent directory.

While I get a significant improvement when none of the directories
change (its much faster to load a file with all the entries in it then
to do a directory search). In particular the first time the app loads
up and has to search every file (around 100,000 and growing) which is
painfully slow (2 or 3 minutes to start up the app).

What techniques/APIs can I use to speed up file searching?

Is there a way to more directly look at the raw data that make up the
file-tables?
Show full article (1.13Kb)
3 Comments
  Re: Best sync method for consumer/producer         


Author: Norman Bullen
Date: May 26, 2007 18:27

cbdeja@my-deja.com wrote:
>>Critical sections are valid only between threads in the same process.
>>I've never checked myself how much faster they are supposed to be,
>>relative to semaphores, but critical sections would probably be the
>>right way to go.
>
>
> Thanks for the comment. After a bit of searching, it seems that
> Critical Sections are faster if they don't have to block.
>
> But the producer needs to be blocked when the buffer is already full,
> and the consumer needs to be blocked when the buffer is empty. This
> needs a counting semaphore.
>
> AIUI, a critical section will only block if another thread is
> executing its critical section, and there's no support for counting,
> so it doesn't seem to be suitable in this case.
>
The purpose of a Critical Section is to control access to variables that
maintain the state of the system; not for waiting for state changes. ...
Show full article (2.31Kb)
no comments
  Re: Best sync method for consumer/producer         


Author: cbdeja
Date: May 26, 2007 09:00

> Critical sections are valid only between threads in the same process.
> I've never checked myself how much faster they are supposed to be,
> relative to semaphores, but critical sections would probably be the
> right way to go.

Thanks for the comment. After a bit of searching, it seems that
Critical Sections are faster if they don't have to block.

But the producer needs to be blocked when the buffer is already full,
and the consumer needs to be blocked when the buffer is empty. This
needs a counting semaphore.

AIUI, a critical section will only block if another thread is
executing its critical section, and there's no support for counting,
so it doesn't seem to be suitable in this case.
no comments
  Algorithm collection         


Author: thomas.mertes
Date: May 26, 2007 08:35

Hello,

I created a collection of algorithms which is available under

http://seed7.sourceforge.net/algorith/algorith.htm

If somebody is interested in

- Merge sort
- Computing PI with 1000 decimal digits
- Computing the easter date
- The Lempel Ziv Welch (LZW) compression
- Mersenne prime numbers
- The peasant multiplication

and other algorithms, this is the right place.
If you have some algorithms, I would be glad
to add them (when they are GPL / LGPL).

Greetings Thomas Mertes

Seed7 Homepage: http://seed7.sourceforge.net
Project page: http://sourceforge.net/projects/seed7
1 Comment
  Legality, I don't know         


Author: cnlai
Date: May 26, 2007 05:52

Someone asked me a question, I had no answer

Someone wrote a VC++ program, compiled with an illegal copy of Visual
Studio. He wants to sell this application to another party; he asked me
whether the application is illegal. He thought that the application has no
legal issue, it was the machine having the illegal copy of Visual Studio
that has the problem.

I said I don't know. What should be the correct interpretation ?

Thanks.
1 Comment