On Thursday 29 May 2008 21:35:34 Giacomo Lacava wrote:
> First of all, apologies for the silence post-Christmas. I'll try to
> revive this group and drum up support for the next PyCon in september
> -- actually, Michael, do you need any help with that?
Help will be very welcome - I'll post a summary later :-)
> Second: I'm currently writing a little PyQT application that will use
> threads to ping several websites. Now, I know the specifics of thread
> management in python, but my experience is not huge; can anybody
> reccommend a generic good primer on threads? I'm more interested in
> generic guidelines (how many threads one can afford to start,
> patterns, common mistakes, etc) rather than language-specific howtos
> (but obviously anything python-related would be a bonus).
One thing that is an absolute given is "no unconstrained sharing of data", or
operate on the basic principle of "for any piece of data at any point in
time, have a single reader & single writer for it".
The best model is often message passing - which Kamaelia does in spades, but
I've not done a PyQT example. (If I had it'd probably be the simplest way of
managing the threads).
However there's also software transactional memory as well - which you
can actually think of as version control for variables (without the
versioning :) .
I wrote a small STM library to merge with Kamaelia at Christmas last year,
which is threadsafe, which you can find documented here:
* http://edit.kamaelia.org/STM
I'd write something more detailed than this, but I'm currently debugging our
multicore support :-)
Michael.
--~--~---------~--~----~------------~-------~--~----~
To post: [email protected]
To unsubscribe: [EMAIL PROTECTED]
Feeds available at http://groups.google.com/group/python-north-west/feeds
For more options: http://groups.google.com/group/python-north-west
-~----------~----~----~----~------~----~------~--~---