db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Created: (DERBY-4517) Unnecessary synchronization in TransactionTable.add()
Date Tue, 19 Jan 2010 10:34:54 GMT
Unnecessary synchronization in TransactionTable.add()
-----------------------------------------------------

                 Key: DERBY-4517
                 URL: https://issues.apache.org/jira/browse/DERBY-4517
             Project: Derby
          Issue Type: Improvement
          Components: Store
    Affects Versions: 10.6.0.0
            Reporter: Knut Anders Hatlen
            Priority: Minor


impl.store.raw.xact.TransactionTable.add() has a synchronized block around the code that adds
a transaction to the transaction table. It synchronizes on "this".

My understanding of the synchronization in the TransactionTable class is that synchronization
on "this" is only used to give a consistent view of the set of update transactions. It is
typically used to guard state transitions for transactions from read to update, removal of
update transactions from the table, and writing the update transactions to the log during
checkpointing.

No transition to/from update happens in this synchronized block (the entry that's added is
initialized with the update flag cleared), so I believe that the synchronization could be
removed. The code will still be implicitly synchronized on the Hashtable so that it should
be safe to access it from multiple threads.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message