[rabbitmq-discuss] AMQP & Python Write-Up

Jason J. W. Williams jasonjwwilliams at gmail.com
Wed Jan 14 23:12:10 GMT 2009


py-amqplib seems to work very well with the new multiprocessing module
in Python 2.6 (available as a backport for 2.5 as well). The samples
in the write-up are simplified versions of a multi-process consumer I
wrote to test RabbitMQ. A multi-process consumer app was around 30
lines of code (including whitespace).

-J

On Wed, Jan 14, 2009 at 4:04 PM, Tim Coote <tim+rabbitmq.com at coote.org> wrote:
> Surely one of the great benefits of a messaging programming style is
> that you can use processes rather than threads.
>
> Threads will surely become a bottleneck as future hardware speed
> improvements move to multicore and so cannot support shared state. So,
> we can move back to the relatively safer and lower cost ($ to build
> and maintain) process based software models.
>
> Although Python supports a threading model, the GIL makes it
> ineffective in many cases.  I suspect that this is deliberate on
> Guido's part.
>
>
>>> I called py-amqplib non-threadsafe because the docs say not to share
>>> channels between threads. So I suppose it would be more accurate to
>>> say, the library is threadsafe if you do not share channel objects
>>> between threads.
>>
>> IIRC Barry's first incarnation was threadless and hence threadsafe.
>
> Tim Coote
> tim at coote.org
> vincit veritas
>
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>




More information about the rabbitmq-discuss mailing list