Re: [picocontainer-dev] Commit 5799 Race Condition Fix....

Paul Hammant <[email protected]> Tue, 8 Nov 2011 10:58:30 -0600
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <CA+298UiQ2Hz2HhGCWTN07FGP0GmC7Yij=7JE+39Kj+3ke+GPhA@mail.gmail.com>
--f46d04447f11b17a6304b13c1482
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Yup that wikipedia entry highlights a bug.  Good catch & thanks for
weighing in Pete.

There's another bug-fix that should perhaps make it into a 2.14.1 release -
PICO-382 and PICO-384.  I've looked at the former's testcase and compiled
it for the sake of a test.  I'm somewhat hogtied at the moment for
interactive debugging as JetBrains's haven't given Codehaus a new Intellij
license yet :-(

- Paul

On Mon, Nov 7, 2011 at 8:07 PM, Michael Rimov <[email protected]> wrote=
:

> Oh that=92s good, I remember when even volatile wasn=92t enough and you h=
ad to
> synchronize the whole method=85. I don=92t miss the days of JDK 1.0 (rofl=
)****
>
> ** **
>
> However, the variable =91initialized=92 wasn=92t declared as volatile, so=
 I=92ve
> done it and checked it in=85 as I patch pico 3 I=92ll go over it and see =
if
> there=92s more items like that and I=92ll get that fixed.****
>
> ** **
>
> Paul:  Sorry I had the name wrong, it=92s =91double-checked locking=92, n=
ot
> =91double-lock checking=92  Anyway, if you aren=92t familiar with it, Wik=
ipedia=92s
> writeup isn=92t too shabby:****
>
> http://en.wikipedia.org/wiki/Double-checked_locking****
>
> ** **
>
> When I=92m done going through the code, I=92ll let you guys know so you c=
an
> release a 2.14.1 if we don=92t get other things fixed when I=92m done.***=
*
>
> ** **
>
>
> -Mike****
>
> ** **
>
> ** **
>
> *From:* peter royal [mailto:[email protected]]
> *Sent:* Monday, November 07, 2011 5:42 PM
> *To:* dev-qxt/[email protected]
> *Subject:* Re: [picocontainer-dev] Commit 5799 Race Condition Fix....****
>
> ** **
>
> it's safe in modern vms as long as injectionMembers is declared volatile*=
*
> **
>
> ** **
>
> -pete
>
> -- ****
>
> (peter.royal|osi)@pobox.com - http://fotap.org/~osi****
>
>
> On Nov 7, 2011, at 7:31 PM, Paul Hammant <[email protected]> wrote:****
>
> I eliminated the situation I was getting in a production deployment.  I'm
> not sure what you mean Mike.****
>
> ** **
>
> -ph****
>
> On Mon, Nov 7, 2011 at 6:43 PM, Michael Rimov <[email protected]>
> wrote:****
>
> Paul,
>
> I was looking @ the diffs....  and this code in Iterative adapter:
>
>       if (injectionMembers =3D=3D null) {
>            synchronized (this) {
>                if (injectionMembers =3D=3D null) {
>                    initializeInjectionMembersAndTypeLists();
>                }
>            }
>        }
>
> Isn't that double-check locking and not really solving the race condition=
?
> Or is Boolean assignment exempt from this kind of situation?
>
>
> -Mike
>
>
>
> -----Original Message-----
> From: Paul Hammant [mailto:[email protected]]
> Sent: Monday, November 07, 2011 11:53 AM
> To: dev-qxt/[email protected]
> Subject: Re: [picocontainer-dev] Release of Pico 2.14
>
> My bad - I've only just done the nexus 'approval'.  Give it four hours or
> so.  Meanwhile build from source :
>
>
> http://svn.codehaus.org/picocontainer/java/2.x/tags/picocontainer-2.14/
>     mvn clean install -DskipTests -Preporting
>
> On Mon, Nov 7, 2011 at 1:28 PM, Simon Brandhof <[email protected]>
> wrote:
> > Hi Paul,
> >
> > Will this release be deployed in Maven repository ?
> >
> > Thanks
> >
> >
> > On 7 November 2011 19:04, Paul Hammant <[email protected]> wrote:
> >>
> >> Hey Mike.  The answer is I'm not sure.  It's pretty up to date - go
> >> for it:  The stuff that's in the latest release isn't in 3.x / Git
> >> yet.
> >>
> >> - Paul
> >>
> >> On Mon, Nov 7, 2011 at 10:38 AM, Michael Rimov
> >> <[email protected]>
> >> wrote:
> >> > Hey Paul,
> >> >
> >> > What is the last change you ported over to Pico 3?
> >> >
> >> > I'll be happy to manually port based on the diffs, but I wanted to
> >> > make sure before I started that I wasn't duplicating efforts.
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
> ****
>
> ** **
>
>

--f46d04447f11b17a6304b13c1482
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Yup that wikipedia entry highlights a bug. =A0Good catch &amp; thanks for w=
eighing in Pete.<div><br></div><div>There&#39;s another bug-fix that should=
 perhaps make it into a 2.14.1 release - PICO-382 and PICO-384. =A0I&#39;ve=
 looked at the former&#39;s testcase and compiled it for the sake of a test=
. =A0I&#39;m somewhat hogtied at the moment for interactive debugging as Je=
tBrains&#39;s haven&#39;t given Codehaus a new Intellij license yet :-(<br>
<div><br></div><div>- Paul<br>
<br><div class=3D"gmail_quote">On Mon, Nov 7, 2011 at 8:07 PM, Michael Rimo=
v <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"=
_blank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex">

<div bgcolor=3D"white" lang=3D"EN-US" link=3D"blue" vlink=3D"purple"><div><=
p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;color:#1F497D">Oh tha=
t=92s good, I remember when even volatile wasn=92t enough and you had to sy=
nchronize the whole method=85. I don=92t miss the days of JDK 1.0 (rofl)<u>=
</u><u></u></span></p>

<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;color:#1F497D"><u></=
u>=A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0=
pt;color:#1F497D">However, the variable =91initialized=92 wasn=92t declared=
 as volatile, so I=92ve done it and checked it in=85 as I patch pico 3 I=92=
ll go over it and see if there=92s more items like that and I=92ll get that=
 fixed.<u></u><u></u></span></p>

<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;color:#1F497D"><u></=
u>=A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0=
pt;color:#1F497D">Paul:=A0 Sorry I had the name wrong, it=92s =91double-che=
cked locking=92, not =91double-lock checking=92=A0 Anyway, if you aren=92t =
familiar with it, Wikipedia=92s writeup isn=92t too shabby:<u></u><u></u></=
span></p>

<p class=3D"MsoNormal"><a href=3D"http://en.wikipedia.org/wiki/Double-check=
ed_locking" target=3D"_blank">http://en.wikipedia.org/wiki/Double-checked_l=
ocking</a><u></u><u></u></p><p class=3D"MsoNormal"><u></u>=A0<u></u></p><p =
class=3D"MsoNormal">

<span style=3D"font-size:11.0pt;color:#1F497D">When I=92m done going throug=
h the code, I=92ll let you guys know so you can release a 2.14.1 if we don=
=92t get other things fixed when I=92m done.<u></u><u></u></span></p><p cla=
ss=3D"MsoNormal">

<span style=3D"font-size:11.0pt;color:#1F497D"><u></u>=A0<u></u></span></p>=
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;color:#1F497D">=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 -Mike<u></u><u></u></sp=
an></p>

<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt;color:#1F497D"><u></=
u>=A0<u></u></span></p><p class=3D"MsoNormal"><span style=3D"font-size:11.0=
pt;color:#1F497D"><u></u>=A0<u></u></span></p><div><div style=3D"border:non=
e;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">

<p class=3D"MsoNormal"><b><span style=3D"font-size:10.0pt">From:</span></b>=
<span style=3D"font-size:10.0pt"> peter royal [mailto:<a href=3D"mailto:pet=
[email protected]" target=3D"_blank">[email protected]</a>] <br><b>Sen=
t:</b> Monday, November 07, 2011 5:42 PM<br>

<b>To:</b> <a href=3D"mailto:dev-qxt/[email protected]" target=3D"_bla=
nk">dev-qxt/[email protected]</a><br><b>Subject:</b> Re: [picocontaine=
r-dev] Commit 5799 Race Condition Fix....<u></u><u></u></span></p></div></d=
iv>

<div><div></div><div><p class=3D"MsoNormal"><u></u>=A0<u></u></p><div><p cl=
ass=3D"MsoNormal">it&#39;s safe in modern vms as long as injectionMembers i=
s declared volatile<u></u><u></u></p></div><div><p class=3D"MsoNormal">
<u></u>=A0<u></u></p></div><div><p class=3D"MsoNormal">-pete<br><br>--=A0<u=
></u><u></u></p><div><p class=3D"MsoNormal">(peter.royal|osi)@<a href=3D"ht=
tp://pobox.com" target=3D"_blank">pobox.com</a> - <a href=3D"http://fotap.o=
rg/~osi" target=3D"_blank">http://fotap.org/~osi</a><u></u><u></u></p>

</div></div><div><p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt"><br>=
On Nov 7, 2011, at 7:31 PM, Paul Hammant &lt;<a href=3D"mailto:paul@hammant=
.org" target=3D"_blank">[email protected]</a>&gt; wrote:<u></u><u></u></p></=
div>

<blockquote style=3D"margin-top:5.0pt;margin-bottom:5.0pt"><div><p class=3D=
"MsoNormal">I eliminated the situation I was getting in a production deploy=
ment. =A0I&#39;m not sure what you mean Mike.<u></u><u></u></p><div><p clas=
s=3D"MsoNormal">

<u></u>=A0<u></u></p></div><div><p class=3D"MsoNormal" style=3D"margin-bott=
om:12.0pt">-ph<u></u><u></u></p><div><p class=3D"MsoNormal">On Mon, Nov 7, =
2011 at 6:43 PM, Michael Rimov &lt;<a href=3D"mailto:[email protected]"=
 target=3D"_blank">[email protected]</a>&gt; wrote:<u></u><u></u></p>

<p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt">Paul,<br><br>I was lo=
oking @ the diffs.... =A0and this code in Iterative adapter:<br><br>=A0 =A0=
 =A0 if (injectionMembers =3D=3D null) {<br>=A0 =A0 =A0 =A0 =A0 =A0synchron=
ized (this) {<br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (injectionMembers =3D=3D=
 null) {<br>

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0initializeInjectionMembersAndTypeLis=
ts();<br>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}<br>=A0 =A0 =A0 =A0 =A0 =A0}<br>=
=A0 =A0 =A0 =A0}<br><br>Isn&#39;t that double-check locking and not really =
solving the race condition?<br>Or is Boolean assignment exempt from this ki=
nd of situation?<br>

<br><br>-Mike<br><br><br><br>-----Original Message-----<br>From: Paul Hamma=
nt [mailto:<a href=3D"mailto:[email protected]" target=3D"_blank">paul@hamma=
nt.org</a>]<br>Sent: Monday, November 07, 2011 11:53 AM<br>To: <a href=3D"m=
ailto:dev-qxt/[email protected]" target=3D"_blank">[email protected]=
odehaus.org</a><br>

Subject: Re: [picocontainer-dev] Release of Pico 2.14<br><br>My bad - I&#39=
;ve only just done the nexus &#39;approval&#39;. =A0Give it four hours or<b=
r>so. =A0Meanwhile build from source :<br><br>=A0 =A0 <a href=3D"http://svn=
.codehaus.org/picocontainer/java/2.x/tags/picocontainer-2.14/" target=3D"_b=
lank">http://svn.codehaus.org/picocontainer/java/2.x/tags/picocontainer-2.1=
4/</a><br>

=A0 =A0 mvn clean install -DskipTests -Preporting<br><br>On Mon, Nov 7, 201=
1 at 1:28 PM, Simon Brandhof &lt;<a href=3D"mailto:[email protected]=
" target=3D"_blank">[email protected]</a>&gt;<br>wrote:<br>&gt; Hi P=
aul,<br>

&gt;<br>&gt; Will this release be deployed in Maven repository ?<br>&gt;<br=
>&gt; Thanks<br>&gt;<br>&gt;<br>&gt; On 7 November 2011 19:04, Paul Hammant=
 &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
</a>&gt; wrote:<br>

&gt;&gt;<br>&gt;&gt; Hey Mike. =A0The answer is I&#39;m not sure. =A0It&#39=
;s pretty up to date - go<br>&gt;&gt; for it: =A0The stuff that&#39;s in th=
e latest release isn&#39;t in 3.x / Git<br>&gt;&gt; yet.<br>&gt;&gt;<br>&gt=
;&gt; - Paul<br>

&gt;&gt;<br>&gt;&gt; On Mon, Nov 7, 2011 at 10:38 AM, Michael Rimov<br>&gt;=
&gt; &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">rimovm@=
centercomp.com</a>&gt;<br>&gt;&gt; wrote:<br>&gt;&gt; &gt; Hey Paul,<br>&gt=
;&gt; &gt;<br>

&gt;&gt; &gt; What is the last change you ported over to Pico 3?<br>&gt;&gt=
; &gt;<br>&gt;&gt; &gt; I&#39;ll be happy to manually port based on the dif=
fs, but I wanted to<br>&gt;&gt; &gt; make sure before I started that I wasn=
&#39;t duplicating efforts.<br>

&gt;&gt; &gt;<br>&gt;&gt;<br>&gt;&gt; -------------------------------------=
--------------------------------<br>&gt;&gt; To unsubscribe from this list,=
 please visit:<br>&gt;&gt;<br>&gt;&gt; =A0 =A0<a href=3D"http://xircles.cod=
ehaus.org/manage_email" target=3D"_blank">http://xircles.codehaus.org/manag=
e_email</a><br>

&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt;<br><br>-------------------------------=
--------------------------------------<br>To unsubscribe from this list, pl=
ease visit:<br><br>=A0 =A0<a href=3D"http://xircles.codehaus.org/manage_ema=
il" target=3D"_blank">http://xircles.codehaus.org/manage_email</a><br>

<br><br><br>---------------------------------------------------------------=
------<br>To unsubscribe from this list, please visit:<br><br>=A0 =A0<a hre=
f=3D"http://xircles.codehaus.org/manage_email" target=3D"_blank">http://xir=
cles.codehaus.org/manage_email</a><br>

<br><u></u><u></u></p></div><p class=3D"MsoNormal"><u></u>=A0<u></u></p></d=
iv></div></blockquote></div></div></div></div></blockquote></div><br></div>=
</div>

--f46d04447f11b17a6304b13c1482--