cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Øyvind Harboe" <oyvind.har...@zylin.com>
Subject Re: weakly referenced paged queries
Date Fri, 20 Jun 2008 19:41:51 GMT
On Fri, Jun 20, 2008 at 7:34 PM, Scott Anderson <sanderson@airvana.com> wrote:
> It looks like the synchronized block is designed to prevent concurrent modification
>  of the list. I don't believe that particular code would suffer the consequences
> if concurrent modification occurred, but it's generally best to synchronize
> list access when in doubt, since even a simple iteration can be the offender.

I find that code that is added because one hasn't defined what the
interface should be, is trouble waiting to happen.

I would be much more comfortable, if either:

- the JavaDoc explained *why* the synchronization is there and what it
is supposed to do and how the client is supposed to use it.
- it serves some internal purpose and that purpose was stated as a comment
in the code
- the synchronization code was deleted(faster + less chance of deadlock).

-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 XScale Cortex
JTAG debugger and flash programmer

Mime
View raw message