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?