Concurrency, I guess

Grant Edwards grante at visi.com
Mon Jan 23 15:55:40 EST 2006


On 2006-01-23, Stormcoder <stormtoad at gmail.com> wrote:

> Using candygram you can send the sync thread a message telling it to
> reread the config file or you could send a message that changes the
> setting directly. Candygram is much better than the standard threading
> module which is designed after the Java threading library. Java
> recently added another threading library because the old one was not
> adequate.
>
> The reason you can't simply share a global variable is that threads do
> not share state.

Maybe that's true for "candygram", but it's certainly not true
for the the standard "treading" module.

> You have to go through a lot of trouble to share that state.
> First you have to setup some form of interprocess
> communications such as a memory mapped file, shared mem, pipe,
> socket etc. You then have to implement locking and try to
> debug what you have done.

If that's what you have to do when using candygram, then it
sounds like a lot of work compared to the standard "threading"
module where threads all share a global address space.

> Debugging multi threaded programs is inherently difficult. I
> would highly recommend using candygram or an asynchronous
> library, since it sounds like you haven't done any
> multi-threaded programming before.


> In candygram you can send threads messages which don't require
> any synchronization or IPC setup.

Same with the "threading" module.

-- 
Grant Edwards                   grante             Yow!  ... I'm IMAGINING a
                                  at               sensuous GIRAFFE, CAVORTING
                               visi.com            in the BACK ROOMof a KOSHER
                                                   DELI --



More information about the Python-list mailing list