[erlang-questions] queues (previously: documentation of data structures)

Andras Georgy Bekes bekesa@REDACTED
Tue Dec 11 15:16:50 CET 2007

> The killing Con is that one process may keep a megabyte
> in the queue making this queue performance excruciatingly
> slow for all other processes due to repeating message
> queue scans.
You're right.

> I saw a bug in your code: myqueue:delete/1 dose not stop the queue
> process.
You too.
I hacked that module in 2 minutes, so I'm happy with that bug :-)

> > - - add two elements at the begining of the queue
> queue != dequeue.
> > - - remove elements from the end of the queue
> queue != dequeue, so this shouldn't necessarily be possible.
Everybody is right.

The module I've written implements a queue. However, the queue module in 
OTP implements a deque (only with funny function names). Probably this 
is the source of confusion.

Anyways, queue:lait/1 should be liat/1 shouldn't it? Both in the doc and 
impl. (It is the opposite of tail. The opposite of cons/2 is snoc/2, 
the opposite of head/1 is daeh/1 but lists:reverse("tail") /= "lait").


More information about the erlang-questions mailing list