<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>The ifAbsentBlock is being evaluated in&nbsp;the 
critical section of this method.&nbsp; As a result, this block cannot modify the 
btreeDictionary.&nbsp; If we move the ifAbsentBlock&nbsp;evaluation to outside 
of the critical section would this method still be "correct"?&nbsp; Here is how 
it would read:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>valueAt: aKey ifAbsent: 
aBlock<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Private - Answer correct 
version of value holder at aKey, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
evaluate aBlock if absent."</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; | value |<BR>&nbsp;&nbsp;&nbsp; 
changed == nil ifFalse: [<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value := 
changed at: aKey.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value == nil 
ifFalse: [ ^value ]<BR>&nbsp;&nbsp;&nbsp; ].<BR>&nbsp;&nbsp;&nbsp; 
dataBaseObject == nil ifTrue: [ ^aBlock value ].<BR>&nbsp;&nbsp;&nbsp; "critical 
section begin"<BR>&nbsp;&nbsp;&nbsp; mutex critical: 
[<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (value := dataBaseObject 
iterator goTo: aKey; getCurrent)&nbsp;&nbsp;&nbsp;&nbsp; 
].<BR>&nbsp;&nbsp;&nbsp; "critical section end"</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; "evaluate aBlock outside the 
critical section"</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; value == 
nil<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
ifTrue: [^aBlock value].<BR>&nbsp;&nbsp;&nbsp; value := ODBValueHolder createOn: 
value value.<BR>&nbsp;&nbsp;&nbsp; [transaction versionDescriptor versionOK: 
value versionNumber]<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; whileFalse: 
[value loadPreviousVersionFrom: transaction oldHolders].<BR>&nbsp;&nbsp;&nbsp; 
^value</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks.</FONT></DIV>
<DIV><FONT face=Arial size=2>Derek Brans<BR>Nerd on a Wire<BR>Web design that's 
anything but square<BR><A 
href="http://www.nerdonawire.com">http://www.nerdonawire.com</A> <BR>mailto: <A 
href="mailto:brans@nerdonawire.com">brans@nerdonawire.com</A><BR>phone: 
604.874.6463<BR>toll-free: 1-877-NERD-ON-A-WIRE</FONT></DIV></BODY></HTML>