SNIP IT: Object gatekeeper for multithread apps.

Gustavo Cordova gcordova at hebmex.com
Thu Jun 6 18:39:21 EDT 2002


Hi y'all.

I've been toying around with multithreading apps,
and one of the (small) deficiencies I've seen is
that, besides Queue, there's no other object gatekeeper
to regulate access to shared objects.

Now; Queue is quite cool, very nice. But, because of
it's design (I mean, it *is* a queue), only the objects
at the top can be accessed (or the bottom... you know).

Also, they have no name. I didn't like that.

So, I began writing my own gatekeeper. I've been
through many iterations, each one getting killed because
of my inherent developer paranoia ("And, what if one
thread does this... *damn*, another deadlock posibility").

Until this version. It seems as clean as it's ever gonna
get, so I'm sending it out to the wild, in hopes that
it may prove useful to somebody else.

Please, enjoy.

Also, I'm taking bug reports, *possible* bugs,
design deficiencies (or improvements!), and also,
please please please, a better name :-) "Holder"
just doesn't ring right.

So, please, enjoy.

-gustavo

pd: Ah! This is 2.2+ specific, because it uses properties.
    Sorry for all you pre-2.2 programmers. This is my
    properties self-test-exam. I Passed!! ;-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Holder.py
Type: application/octet-stream
Size: 6394 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20020606/e0b33d94/attachment.obj>


More information about the Python-list mailing list