[Webkit-unassigned] [Bug 29115] Allow multiple read transactions to run concurrently on the same DB thread

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 17 13:49:00 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=29115





--- Comment #6 from Michael Nordman <michaeln at google.com>  2009-09-17 13:48:59 PDT ---
Getting there... the introduction of the CoordinationInfo struct is good, the
algorithm is easier to follow as a result... please rename the data members and
types used for even greater clarity...

 50         typedef HashMap<String, TransactionsQueue> TransactionsHashMap;
 51         struct CoordinationInfo {
 52             TransactionsQueue pendingTransactions;
 53             int numPendingWriteTransactions;
 54         };
 55         typedef HashMap<String, CoordinationInfo> TransactionsHashMap;
 56         TransactionsHashMap m_pendingTransactions;

on the new struct, add a default ctor that zero-inits
numPendingWriteTransactions 

add a code comment that indicates the String identifies a database file

typedef HashMap<String, CoordinationInfo> CoordinationInfoMap;
CoordinationInfoMap m_coordinationInfoMap;

89     CoordinationInfo& cInfo = it->second;

I think webkit style would have you call this either 'info' or
'coordinationInfo', the cJazz has a hungarian sounds to it.

57         CoordinationInfo cInfo;
58         cInfo.numPendingWriteTransactions = 0;
59         it = m_pendingTransactions.add(dbIdentifier, cInfo).first;

subtract two lines

it = m_coordinationInfoMap.add(dbIdentifier, CoordinationInfo()).first;


 131             if (!cInfo.pendingTransactions.first()->isReadOnly())
 132                 cInfo.pendingTransactions.first()->lockAcquired();
 133             else {
 134                 TransactionsQueue::iterator pt_it =
cInfo.pendingTransactions.begin();
 135                 while ((pt_it != cInfo.pendingTransactions.end()) &&
(pt_it->get()->isReadOnly())) {
 136                     pt_it->get()->lockAcquired();
 137                     ++pt_it;
 138                 }
 139             }

Since the else clause requires braces, put them around the if clause too.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list