Unhappy with Channels?

0 views
Skip to first unread message

Fabian

unread,
Aug 6, 2010, 2:28:52 PM8/6/10
to python-csp
Saluton!

You mentioned in the Europython talk that you are unhappy with the
channels based on files.
Did you try multiprocessing.Queue?

And another question: What exactly is the difference between
Par(p1, p2).start()
and
p1.start(); p2.start()
?

Ĝis, Fabian

Sarah Mount

unread,
Aug 7, 2010, 10:14:57 AM8/7/10
to pytho...@googlegroups.com
On 6 August 2010 19:28, Fabian <fabian...@gmail.com> wrote:
> Saluton!
>
> You mentioned in the Europython talk that you are unhappy with the
> channels based on files.
> Did you try multiprocessing.Queue?

Briefly, yes. I think I removed it because it has a lot of
synchronisation inside the Queue object, and since our channels have
their own rendezvous it seems like a bad idea to have layers on layers
of semaphores and locks. The main issue with pipes is that you can
easily hit the maximum limit for open files on your OS if you have a
program with many channels / processes. Also multiprocessing opens a
few of these when it create and runs processes, which we may not need.
Richard Taylor and Tony Heskett showed us how to deal with these
issues and the notes from this discussion are on the wiki:

http://code.google.com/p/python-csp/wiki/UsefulStuff

> And another question: What exactly is the difference between
> Par(p1, p2).start()
> and
> p1.start(); p2.start()
> ?

The first should start both p1 and p2 running in parallel, the second
in sequence (should be the same as Seq(p1, p2).start(). If that isn't
the case then there's a bug.

Thanks,

Sarah

--
Sarah Mount, Senior Lecturer, University of Wolverhampton
website:  http://www.snim2.org/
twitter: @snim2

Rune M. Friborg

unread,
Aug 9, 2010, 6:36:37 AM8/9/10
to python-csp


On Aug 7, 4:14 pm, Sarah Mount <mount.sa...@gmail.com> wrote:
> On 6 August 2010 19:28, Fabian <fabian.sno...@gmail.com> wrote:

> > And another question: What exactly is the difference between
> > Par(p1, p2).start()
> > and
> > p1.start(); p2.start()
> > ?
>
> The first should start both p1 and p2 running in parallel, the second
> in sequence (should be the same as Seq(p1, p2).start(). If that isn't
> the case then there's a bug.

This means that your .start method is blocking until the processes
have ended the execution?

That behaviour is probably very confusing for users used to the
multithreading .start and .join methods.

What are your reason for having the .start method at all?

Thanks,
Rune
Reply all
Reply to author
Forward
0 new messages