db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: question about synchonization in RAFContainer4.java for page 0 - from DERBY-3347
Date Tue, 17 Jun 2008 12:01:09 GMT
Mike Matrigali <mikem_app@sbcglobal.net> writes:

> Knut Anders Hatlen wrote:

>> I thought all the non-channel code in RAFContainer was overloaded by
>> methods in RAFContainer4 after DERBY-3347. Which code did you find that
>> still used the old I/O API when running JDK>=1.4?
>>
> This is by all means not a complete list, at this point I am still
> just doing code inspection, so it is hard to figure out what can't be
> called because it is overridden.  I just concentrated on the calls in
> the code
> that used seek and then io do do writes.  So far here are the ones I
> have seen called, just by doing a quick limited set of tests (I also
> verified that RAFContainer4 calls were being made also):
>
> Got to FileContainer.java!getEmbryonicPage
> Got to FileContainer.java!writeAtOffset
> Got to RAFContainer!padFile()
> Got to RAFContainer!writePage()

I think the ones above are OK. All of them are overloaded by methods in
RAFContainer4, except padFile(). In JDK>=1.4, padFile() is only called
when the container is created. I haven't checked, but I would expect
creation of containers to be single-threaded. To be on the safe side, we
should probably create an overload for padFile() as well.

As your stack traces show, the other methods can be called in JDK>=1.4
too, but as far as I can tell, this only happens if the container object
is not an instance of RAFContainer4. In particular, this means
TempRAFContainer objects (which extend RAFContainer, not RAFContainer4)
or RAFContainer objects created by TempRAFContainer.createIdentity().
Since these objects are not instances of RAFContainer4, they'll always
use old I/O and synchronization consistently.

-- 
Knut Anders

Mime
View raw message