[concurrency-interest] New bug pattern, way to common

jason marshall jdmarshall at gmail.com
Tue Mar 25 00:52:13 EDT 2008


Yes, in the bad old days when reflection cost over 100x what it does now.

Today I'd just guard the insert if I was writing the same code, and
just speculatively do the lookup work every time I discovered that the
data was missing.


Or more likely, I just would find something else to work on :)


-Jason


On Mon, Mar 24, 2008 at 8:10 AM, Jason Mehrens
<jason_mehrens at hotmail.com> wrote:
>
>  I assume you were doing something like:
>  void fn(Object that) {
>    synchronize(that.getClass()) {
>    }
>  }
>
>  and not:
>  void fn(Object that) {
>    synchronize(this.getClass()) {
>    }
>  }
>
>  Jason
>
>
> > Date: Sun, 23 Mar 2008 11:57:24 -0700
> > From: jdmarshall at gmail.com
> > To: concurrency-interest at cs.oswego.edu
>
> > Subject: Re: [concurrency-interest] New bug pattern, way to common
> >
> > I can only recall using synchronize(getClass()) willfully in one
> > scenario (a couple occasions), and that was when I was building tables
> > of metadata about classes.
> >
> > I don' tend to use class metadata in that manner anymore, so I haven't
> > used it in quite some time. But I bet plenty of frameworks still do.
> > Especially class manipulation kits, but I suspect Hibernate does as
> > well.
>
>
>
> ________________________________
> Watch "Cause Effect," a show about real people making a real difference.
> Learn more.



-- 
- Jason


More information about the Concurrency-interest mailing list