<div dir="ltr">Richard, <br><br>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.. <div><br></div><div>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. </div><div><br></div><div>- benoit</div></div><br><div class="gmail_quote">On Mon, May 25, 2015 at 3:36 AM Richard A. O'Keefe <<a href="mailto:ok@cs.otago.ac.nz">ok@cs.otago.ac.nz</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 22/05/2015, at 7:04 pm, Raimo Niskanen <<a href="mailto:raimo%2Berlang-questions@erix.ericsson.se" target="_blank">raimo+erlang-questions@erix.ericsson.se</a>> wrote:<br>
><br>
><br>
> Have a look at the brand new map data type.<br>
<br>
It's not clear how that would help.<br>
The original request was for<br>
<br>
> a fast and concurrent data structure that allows me to retrieve the items<br>
> in order and do pop/tail, while still being abble to remove them by key.<br>
<br>
Maps are no more concurrent than lists are.<br>
<br>
When requests like this come along, it would be nice to have a<br>
specification that's a bit more precise.  I read this as<br>
<br>
typeclass Useful_Key key<br>
  -- at a minimum, support equality, maybe support comparison,<br>
  -- possibly equality and hashing.<br>
data Useful_Key key => Thingy key val<br>
<br>
empty :: Thingy key val<br>
<br>
add :: key -> val -> Thingy key val -> Thingy key val<br>
<br>
remove :: key -> Thingy key val -> Thingy key val<br>
<br>
pop :: Thingy key val -> Maybe (key, val, Thingy key val)<br>
<br>
so a sort of dictionary/list hybrid.<br>
<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>