News for hackers. Stuff that matters.
Re:Cogs bad by jasim on Wednesday February 22, 2012 @02:32PM (#3622130)
Even multiple threads - any sort of concurrent access/modification on the same dataset becomes problematic if you just use a HashMap.

Sites that have any kind of download/upload component, even though does not have too much traffic, will need to serve multiple requests using threads/processes.

That is where we normally use relational database. However Redis presents a way to be faster than conventional databases by storing everything in memory. This is as close to a concurrency-safe HashMap that you can get with the least amount of effort.

Re:Cogs bad by willvarfar on Wednesday February 22, 2012 @03:16PM (#3622280)
But Java comes with several currency-safe hash-maps and trees and such - where have you been?

If you think that blocking TCP calls to a redis server that serialises everything is going to be faster than a `new HashSplayTree<String>()` you're absolutely bonkers.

Re:Cogs bad by jshen on Wednesday February 22, 2012 @03:22PM (#3622306)
"This is as close to a concurrency-safe HashMap that you can get with the least amount of effort."

No, it's more effort than using a concurrency-safe HashMap in a JVM process.