Thread safe queue like collection

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Thread safe queue like collection

Esteban A. Maringolo
Hi,

Do Pharo 2 have some sort of queue like collection, where different threads (coming mostly from a Multithread Zinc Server) can push objects into it safely, while a service on the other end can consume the queue?

Regards,

Esteban A. Maringolo
Reply | Threaded
Open this post in threaded view
|

Re: Thread safe queue like collection

Sven Van Caekenberghe-2
SharedQueue ?

On 13 Nov 2013, at 19:16, Esteban A. Maringolo <[hidden email]> wrote:

> Hi,
>
> Do Pharo 2 have some sort of queue like collection, where different threads (coming mostly from a Multithread Zinc Server) can push objects into it safely, while a service on the other end can consume the queue?
>
> Regards,
>
> Esteban A. Maringolo


Reply | Threaded
Open this post in threaded view
|

Re: Thread safe queue like collection

Esteban A. Maringolo
I guess SharedQueue will do it, have you (or anybody) tested it in the context of real multi threaded use?

It is too soon for me to think of a real MQ (with STOMP).

Regards!

Esteban A. Maringolo


2013/11/13 Sven Van Caekenberghe <[hidden email]>
SharedQueue ?

On 13 Nov 2013, at 19:16, Esteban A. Maringolo <[hidden email]> wrote:

> Hi,
>
> Do Pharo 2 have some sort of queue like collection, where different threads (coming mostly from a Multithread Zinc Server) can push objects into it safely, while a service on the other end can consume the queue?
>
> Regards,
>
> Esteban A. Maringolo



Reply | Threaded
Open this post in threaded view
|

Re: Thread safe queue like collection

Sven Van Caekenberghe-2
Yes, I have used it, even extended it.
It looks thread safe, so it should be enough to get started.

On 13 Nov 2013, at 20:08, Esteban A. Maringolo <[hidden email]> wrote:

> I guess SharedQueue will do it, have you (or anybody) tested it in the context of real multi threaded use?
>
> It is too soon for me to think of a real MQ (with STOMP).
>
> Regards!
>
> Esteban A. Maringolo
>
>
> 2013/11/13 Sven Van Caekenberghe <[hidden email]>
> SharedQueue ?
>
> On 13 Nov 2013, at 19:16, Esteban A. Maringolo <[hidden email]> wrote:
>
> > Hi,
> >
> > Do Pharo 2 have some sort of queue like collection, where different threads (coming mostly from a Multithread Zinc Server) can push objects into it safely, while a service on the other end can consume the queue?
> >
> > Regards,
> >
> > Esteban A. Maringolo
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Thread safe queue like collection

Göran Krampe
On 11/13/2013 08:30 PM, Sven Van Caekenberghe wrote:
> Yes, I have used it, even extended it.
> It looks thread safe, so it should be enough to get started.

If you are after something that is more like an in memory SocketStream
then you have the SharedStreams package which I wrote a long time ago,
it is actually pretty cool:

http://map.squeak.org/packagebyname/sharedstreams

I recall that we did find several "holes" in SharedQueue at the time.
SharedStreams also use more fitting prims for characters/bytes.

regards, Göran

Reply | Threaded
Open this post in threaded view
|

Re: Thread safe queue like collection

Stéphane Ducasse
In reply to this post by Esteban A. Maringolo
AtomicQueue

On Nov 13, 2013, at 7:16 PM, Esteban A. Maringolo <[hidden email]> wrote:

> Hi,
>
> Do Pharo 2 have some sort of queue like collection, where different threads (coming mostly from a Multithread Zinc Server) can push objects into it safely, while a service on the other end can consume the queue?
>
> Regards,
>
> Esteban A. Maringolo