Documentation is at http://tcllib.sourceforge.net/doc/prioqueue.html This part of the [struct] (data structures) submodule of [tcllib] provides a prioritized queue. ---- Simple usage example: package require struct 1.3 # create a prioqueue with integer priorities set pq [::struct::prioqueue -integer] # get some random things an put them in the queue for {set i 0} {$i < 100} {incr i} { $pq put item$i [expr {int(rand()*500)}] } # Iterate over the queue and output the items in priority order while {[$pq size]} { puts stdout [$pq get] } # destroy the queue after use $pq destroy ---- [Category Package]; see [struct] - [Tcllib] | [Category Data Structure]