ReadFileEx

ReadFileEx

Post by Tim » Tue, 26 Oct 1999 04:00:00



I have three threads within a DLL, each supporting one device.  Each
thread makes 400 calls to ReadFileEx per second or a total of 1200 calls
per second to ReadFileEx by the DLL.

Using one of the system tools, "System Monitor" I've discovered that I
have a memory leak which works out to one DWORD per call to ReadFileEx.
If I change the number of calls, the leak also decreases so it remains
equal to the number of calls to ReadFileEx.

Oher than the leak, all of the reads are functioning correctly, and the
data is as it should be.

Does anyone have any insight concering what might be happening?

Thanks,
Tim

 
 
 

ReadFileEx

Post by Felix Kasza [MVP » Tue, 26 Oct 1999 04:00:00


Tim,

 > If I change the number of calls, the leak also decreases so it remains
 > equal to the number of calls to ReadFileEx.

I would probably run this on NT next; OS bugs do not tend to be the same
on each platform. That should give a quick indicator of whether you have
an OS problem or not. At the same time, I would run the code under
Bounds Checker, but you probably did that already.

--

Cheers,

Felix.

If you post a reply, kindly refrain from emailing it, too.

No anti-spam address here. Just one comment: IN YOUR FACE!

 
 
 

ReadFileEx

Post by Tim » Wed, 27 Oct 1999 04:00:00



> Tim,

>  > If I change the number of calls, the leak also decreases so it remains
>  > equal to the number of calls to ReadFileEx.

> I would probably run this on NT next; OS bugs do not tend to be the same
> on each platform. That should give a quick indicator of whether you have
> an OS problem or not. At the same time, I would run the code under
> Bounds Checker, but you probably did that already.

> --

> Cheers,

> Felix.

> If you post a reply, kindly refrain from emailing it, too.

> No anti-spam address here. Just one comment: IN YOUR FACE!

The problem occurs in both 98 and NT.

Tim

 
 
 

1. overlapped ReadFileEx simultaneously

Hi, everyone,

I try to read a big file in chunks into memory and process it. I use
FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING .
I use two buffers, and while processing one buffer I let the system reload
the other one with ReadFileEx.

Now, there might be situations where both buffers are empty and I want to
reload them as fast as possible. Both buffers always contain
parts of the file which follow each other (because I process the file
sequentially).

My Question: If I issue ReadFileEx more than once (for sequentially
following blocks int the file), what does the system do? Does it first
process the first ReadFileEx request, then going on to the second one? That
would be good. Or does the system start two threads in parallel, both trying
to load their chunks form the file in parallel? That would be really stupid.

So now I wonder whether I should avoid such situations altogether and make
sure that always only one ReadFileEx is in Progress... What do you think?

Thanks in advance
Thomas Stfe

2. 2924XL - Latest ISO Firmware?

3. ReadFileEx reads wich file???

4. PPP with an NDIS driver

5. Overlapped sockets in Windows95 with ReadFileEx

6. Capture & Preview Pins, Unexpected Behaviour !!

7. ReadFileEx and Serial Ports

8. Seeking Java Experts at DHL Systems, Inc.

9. WIN95 using ReadFileEx for Socket

10. ReadFileEx() failing on win98

11. ReadFileEx/WriteFileEx Example

12. Problem with ReadFileEx on multiple SOCKETs

13. Help: ReadFileEx() on NT returns ERROR_UNEXP_NET_ERR (Error 59)?