HiveBrain v1.2.0
Get Started
← Back to all entries
patterngoMinor

Is there a queue implementation?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
implementationqueuethere

Problem

Can anyone suggest Go container for simple and fast FIFO/queue, Go has 3 different containers: heap, list and vector. Which one is more suitable to implement a queue?

Solution

Either vector or list should work, but vector is probably the way to go. I say this because vector will probably allocate less often than list and garbage collection (in the current Go implementation) is fairly expensive. In a small program it probably won't matter, though.

Context

Stack Overflow Q#2818852, score: 12

Revisions (0)

No revisions yet.