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 {$pg size} { puts stdout [$pg get] } ---- [Category Package]; see [struct] - [Tcllib] | [Category Data Structure]