4 ms·
Java.util.concurrent is one of the most attractive features of java for server programming. ConcurrentHashMap is faster, cleaner and much easier to use than loc
by ntkachov 15y ago
Java.util.concurrent is one of the most attractive features of java for server programming. ConcurrentHashMap is faster, cleaner and much easier to use than locking every time you need a access a shared HashMap. Not only that but it doesn't lock the entire hash, just a partition of what ever you will be accessing.
Also AtomicInt,Float,Long make life easier when dealing with threaded programs.
- jbooth 15y agoDon't forget ExecutorService and the whole concept of sending chunks of work back and forth across synchronizing queues. Best way to write concurrent code in any language IMO, analogous to go's channels/goroutines and erlang's whatever they're called.
- ww520 15y agoJava.util.concurrent.ExecutorService is great. Coupling it with Hazelcast is truly great in creating a dynamic cluster that performs parallel distributed work with ease. One of the pains in setting up server cluster in AWS is the cluster discovery and membership maintenance. Hazelcast does all those automatically.