----- Original Message ----- 
From: "Mathew Johnston" <mjohnston / itactics.com>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Thursday, April 11, 2002 9:44 AM
Subject: Thread safety of Queue.push


> I was wondering if it was safe to have multiple threads all pushing onto
> one Queue at the same time. I noticed that unless you mutex sync on the
> queue, all concurrently popping threads will pop the same object that is
> pushed by another thread (this is alright, I'm just trying to imply that
> I have many many threads pushing and popping all of the time). For now,
> I'm using one mutex to sync pops (I only want one thread to get each
> object) and one to sync pushes (do I really need one for pushes?)

Are you referring to the standard Queue? I haven't looked
at in recently, but I thought the whole idea of it was to be
transparently thread-safe...

Hal Fulton