--- On Fri, 3/12/10, Adam Heath <[email protected]> wrote: > Adrian Crum wrote: > > --- On Fri, 3/12/10, Adam Heath <[email protected]> > wrote: > >> Search for synchronized in > >> ShoppingCart. You'll fine a couple of > >> spots that lock on cartLines, a few that lock in > the class > >> instance > >> itself. But then no other hits. > >> > >> However, tons of internal variables all need to be > kept > >> self-consistent with each other, so locking > against just > >> one or the > >> other of those variables won't work. > > > > These same problems exist in a number of classes - not > just the shopping cart (take a look at SequenceUtil for some > really scary code). That's why I suggested a synchronization > best practices page that the community can follow. > > I have looked at SequenceUtil, and have a version lying > around that is > non-blocking. I need to pull that out of the attic, > and put it in my > staging tree, and run with it for a while.
It would be cool if you could send it to me. I can get SequenceUtil to break fairly easily with my multi-threaded data loading modification - so I think it would be a good test for your code.
