[erlang-questions] how are implemented lists?
Benoit Chesneau
bchesneau@REDACTED
Mon May 25 09:14:59 CEST 2015
Richard,
Indeed; sorry for that: So indeed that is this kind of data structure that
I would like to have. Was thinking to use a skip-list data-structure as a
nif but that may be overkill..
Thinking more about it using a process for it may be more efficient than
using an ETS. Especially that I need to be handle many "queue". As I
understand using many ETS tables i not really advised, and I'm worried
about the performance if I start to store multiple queues per ETS table.
- benoit
On Mon, May 25, 2015 at 3:36 AM Richard A. O'Keefe <ok@REDACTED>
wrote:
>
> On 22/05/2015, at 7:04 pm, Raimo Niskanen <
> raimo+erlang-questions@REDACTED> wrote:
> >
> >
> > Have a look at the brand new map data type.
>
> It's not clear how that would help.
> The original request was for
>
> > a fast and concurrent data structure that allows me to retrieve the items
> > in order and do pop/tail, while still being abble to remove them by key.
>
> Maps are no more concurrent than lists are.
>
> When requests like this come along, it would be nice to have a
> specification that's a bit more precise. I read this as
>
> typeclass Useful_Key key
> -- at a minimum, support equality, maybe support comparison,
> -- possibly equality and hashing.
> data Useful_Key key => Thingy key val
>
> empty :: Thingy key val
>
> add :: key -> val -> Thingy key val -> Thingy key val
>
> remove :: key -> Thingy key val -> Thingy key val
>
> pop :: Thingy key val -> Maybe (key, val, Thingy key val)
>
> so a sort of dictionary/list hybrid.
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150525/ad25a889/attachment.htm>
More information about the erlang-questions
mailing list