[erlang-questions] Problems Writing a Scalable Shared Data Structure

Fuad Tabba fuad@REDACTED
Mon Jul 7 11:00:51 CEST 2008


Thanks Robert,

Yes I am familiar with Amdahl's law. That said, it's not true that all
writes need to be serialized; it's a binary tree, and unless the
modifications happen to be to the same node, there's no reason why they need
to be serialized.

A database would solve the problem kinda; but that's like using a
steamroller to crack a nut. What I'm looking for a lightweight option that
could temporarily store data shared between threads, and would scale well as
the number of threads accessing/modifying this structure increases. I know
how to solve this problem in C (writing a concurrent binary search tree that
scales well), but since I'm new to Erlang I was unsuccessful trying to solve
this problem in Erlang.

Thanks again,
/Fuad

On Mon, Jul 7, 2008 at 8:22 PM, Robert Raschke <rtrlists@REDACTED>
wrote:

> Hi Fuad,
>
> a shared data structure is going to be the major limiting factor of
> your parallelisation. Are you aware of Amdahl's Law (e.g.,
> http://home.wlu.edu/~whaleyt/classes/parallel/topics/amdahl.html<http://home.wlu.edu/%7Ewhaleyt/classes/parallel/topics/amdahl.html>
> )?
>
> I must admit I have not read your code. But at least all the writes to
> your shared data structure have to be serial in order to ensure its
> integrity. So that is an immediate limiting factor. You cannot get
> faster than all the serialised writes to your structure.
>
> One of the easiest shared data structures you can use is a database.
> It'll handle all the horrible details of transactions for you. In
> Erlang, you can have a look at Mnesia for that.
>
> Robby
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080707/4506af27/attachment.htm>


More information about the erlang-questions mailing list