apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc M. Adkins" <mma...@Doorways.org>
Subject submission of new Windows rwlock code
Date Wed, 18 Jun 2003 00:05:37 GMT
I've re-coded the Windows rwlock based on the OS/2 algorithm implemented by
Brian Havard.  My test program doesn't show starvation with this algorithm.
I'm assuming that the code is stable and works correctly on OS/2, and it's
essentially the same code here, plus it passes all the tests I know how to
do so I'm submitting the code for review.

Somewhat to my surprise the performance test program that comes with APR
seems to show an increase in speed of 30% - 50%.  Possibly because the old
code had two mutex waits for a read lock and the new code has one.

I was initially surprised because the new code has tests on return values
and an extra level of subroutine calling not present in the old code.  Not
to mention additional functionality:  tryrdlock and trywrlock are both
working now and starvation should be prevented.  When does more
functionality ever mean faster?

I'm attaching the two changed files, which were essentially rewritten.  So
far as I can tell, the 2.1 code is still the same in CVS, so just replacing
the files in their entirety should be sufficient.  I can do diffs if that is
better.  I don't personally have CVS write access.

mma

Mime
View raw message