[erlang-questions] Noddy question on hashing

Rick Payne <>
Thu Jul 25 11:52:27 CEST 2013


Hi,

I've been using erlang for some simple projects, and really enjoying 
it. However, when thinking about some of the things I'd like to do - 
I'm struggling a bit with hashing and how to handle that in a 
concurrent way in erlang. This is probably 101 stuff, sorry...

Imagine we have a set of data streams giving us objects and attributes. 
Attributes can be a few kB but typically are less than 1kB. The objects 
are unique but some set of them share the attributes. Typically in C, 
I'm used to hashing the attributes and pointing at them from the 
objects. We hash to save memory and refcount so we know when we can 
delete from the hash. The good news is that the attributes are never 
updated in place, apart from the refcount.

However, I'm struggling to get my head around how I'd do this in erlang 
efficiently. Any suggestions?

Cheers,
Rick




More information about the erlang-questions mailing list