[Ace-users] pread/pwrite implementation for ACE_HAS_WINNT4 performance
daniel.schenk at schiller.ch
daniel.schenk at schiller.ch
Tue Oct 30 05:12:27 CDT 2007
Hi
in ace\OS_NS_unistd.cpp the ACE_WIN32 implementation of ACE_OS::pread
uses
1. ACE_OS_GUARD to synchronize access
2. gets the current file pointer, set it to the desired offset and
restores it after reading
Both should be unnecessary if ACE_HAS_WINNT4 is defined.
Because ::ReadFile is used with an OVERLAPPED structure. ::ReadFile
will set the offset internally, which is passed inside the OVERLAPPED
structure. Therefore there will be no need for synchronization by
ACE_OS_GUARD.
This will mean that the current implementation for ACE_HAS_WINNT4
unnecessarily calls SetFilePointer 3 times and locks, which will of
course slow down the performance.
The same will be true for ACE_OS::pwrite.
Please correct me, if I'm wrong. Otherwise I would appreciate if you
could change the code.
best regards
Daniel Schenk
More information about the Ace-users
mailing list