JavaMemoryModel: re: Threading issues in my connection pool

From: Thomas Wang (wang@cup.hp.com)
Date: Fri Sep 01 2000 - 13:05:35 EDT


David,

>There are a few techniques I am using to avoid synchronization:
>double check idiom
>copy on write

You shouldn't be afraid of synchronization, because if there is a
performance bottleneck, you can always use a pool of servers to service
requests.

For example, you can have 16 servers, each will service some objects,
based on the lower 4 bit hash value of the object.

Now, only synchronize on update, and not synchronizing on read is a problem,
because the reader can read old or intermediate results. Some of the
Java system library code is guilty of this practice.

Double check idiom is probably hopeless- it doesn't even work in some
of current JVMs for single processor machine.

 -Thomas Wang
 wang@cup.hp.com

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:27 EDT