multithreading

François Pinard pinard at iro.umontreal.ca
Wed May 29 18:48:15 EDT 2002


[Aahz]

> But I'll bet you find it difficult to name a principle that Queue fails
> to satisfy.

While I'm very happy to use Queue where I feel it well fits, it looks like
a bit of overkill in other circumstances.

Using Queue also means creating client-server relationships for handling data
movement.  In a threaded project, implemented queues are quite fundamental in
the overall description of the project design and algorithms, but I would not
overly multiply queues for each and every tiny aspect of data movement, when
mere locks are sufficient.  Multiplying queues for everything and everywhere
in a project might impair its overall legibility, drawning the fish.

So, the principle I would be tempted to invoke against abusing of Queue is
the principle of simplicity.  We both agree on that, when Queue is proper,
that is, when the appropriate client-server relation already exists in a
project, Queue represents a simple, straightforward and legible approach.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list