Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Alternative to Java Synchronized?

807569Sep 6 2006 — edited Sep 7 2006
I have made a simple HTTP server that starts a new thread each time a new client connects.

Each client can add, get or remove a text string from an ArrayList on the server.

The concurrency in the program could be solved by synchronizing the ArrayList like:
List items = Collections.synchronizedList(new ArrayList());
But I have heard that Java Synchronized is not very efficient and even has some security holes. What are the alternative to using Java Synchronized, if I would like to make an efficient concurrent system?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 5 2006
Added on Sep 6 2006
17 comments
532 views