[erlang-questions] how are implemented lists?
Mon May 25 09:14:59 CEST 2015
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.
On Mon, May 25, 2015 at 3:36 AM Richard A. O'Keefe <>
> On 22/05/2015, at 7:04 pm, Raimo Niskanen <
> > 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions