# Is there a thread safe implementation of a priority queue?

**URL:** <https://www.ruby-forum.com/t/is-there-a-thread-safe-implementation-of-a-priority-queue/112062>\
**Category:** Ruby\
**Created:** [August 14, 2007, 9:01pm UTC](https://www.ruby-forum.com/t/is-there-a-thread-safe-implementation-of-a-priority-queue/112062 "2007-08-14T21:01:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dizzyone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dizzyone](https://www.ruby-forum.com/u/dizzyone)\
**Post date:** [August 14, 2007, 9:01pm UTC](https://www.ruby-forum.com/t/is-there-a-thread-safe-implementation-of-a-priority-queue/112062/1 "2007-08-14T21:01:35Z")

</div>

I could only find a class called Queue in RDoc. Is there no (thread  
safe) priority queue? If not where can I get one?

Turing.

---

<div class="post-metadata">

**Author:** ![dizzyone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dizzyone](https://www.ruby-forum.com/u/dizzyone)\
**Post date:** [August 15, 2007, 5:57pm UTC](https://www.ruby-forum.com/t/is-there-a-thread-safe-implementation-of-a-priority-queue/112062/2 "2007-08-15T17:57:53Z")

</div>

Joel VanderWerf wrote:

> Frank M. wrote:
> 
> > I could only find a class called Queue in RDoc. Is there no (thread  
> > safe) priority queue? If not where can I get one?
> 
> There’s some hits in this search that may help:
> 
> [ruby priorityqueue - Google Search](http://www.google.com/search?q=ruby+priorityqueue)
> 
> Here’s one that I use based on the rbtree extension:
> 
> [http://raa.ruby-lang.org/project/ruby-rbtree](http://raa.ruby-lang.org/project/ruby-rbtree)  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/133202](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/133202)  
> I already searched myself and I came upon the “rbtree” queue, too but I  
> can’t remember why I dismissed this one. Maybe I was just too tired  
> yesterday.  
> Thanks.

Turing.

---

<div class="post-metadata">

**Author:** ![dizzyone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dizzyone](https://www.ruby-forum.com/u/dizzyone)\
**Post date:** [August 21, 2007, 8:26pm UTC](https://www.ruby-forum.com/t/is-there-a-thread-safe-implementation-of-a-priority-queue/112062/3 "2007-08-21T20:26:54Z")

</div>

Joel VanderWerf wrote:

> Frank M. wrote:  
> [http://raa.ruby-lang.org/project/ruby-rbtree](http://raa.ruby-lang.org/project/ruby-rbtree)

I finally had the time to download and try this priority queue, but  
unfortunately the required RBTree class is a C extension and the  
makefile is written for GCC which I don’t have (installed).  
Could someone be so kind and compile this extension (with windows) and  
upload it for me?

Thank you very much!

Turing

---

<div class="post-metadata">

**Author:** ![dizzyone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dizzyone](https://www.ruby-forum.com/u/dizzyone)\
**Post date:** [August 14, 2007, 10:57pm UTC](https://www.ruby-forum.com/t/is-there-a-thread-safe-implementation-of-a-priority-queue/112062/4 "2007-08-14T22:57:08Z")

</div>

Frank M. wrote:

> I could only find a class called Queue in RDoc. Is there no (thread  
> safe) priority queue? If not where can I get one?

There’s some hits in this search that may help:

[http://www.google.com/search?q=ruby+priorityqueue](http://www.google.com/search?q=ruby+priorityqueue)

Here’s one that I use based on the rbtree extension:

[http://raa.ruby-lang.org/project/ruby-rbtree](http://raa.ruby-lang.org/project/ruby-rbtree)  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/133202](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/133202)
