[IPython-dev] IPython-ZMQ about client and server division.

Brian Granger ellisonbg at gmail.com
Thu May 13 01:26:29 EDT 2010


Thanks for bringing this discussion to the list...

On Wed, May 12, 2010 at 10:06 PM, Gerardo Gutierrez
<muzgash.lists at gmail.com> wrote:
> Hi everyone.
>
> This week, Omar and I were discussing about the fundamentals of this project
> (again) which apparently are not clear enough (at least for me).
> The thing here that I'm talking about is based on Omar's idea that every
> other frontend should connect to the client not the kernel, I'm referring to
> the *client* as a frontend because I think it should be written in the same
> manner as the other frontends, this is if the frontends were going to
> connect to the kernel, as I thought initially.

The frontends should definitely all connect directly to the kernel.
There are a number of reasons for this, but the main one is that the
frontends may all go away while the kernel remains.  When a frontend
tries to connect to the kernel, there may be no other frontends in
existence.

> This idea, I think, will lighten the tasks the other frontends will have,
> but I think also, that the idea of having to rely on two processes for a
> simple client/frontend (Qt,ncurses,etc) is not healthy.

The benefits of a two process model, even for the simplest possible
case, are huge:

* Isolation - either part can die, but the other remains, so you can
simple re-start the part the died and continue.
* Easy to do a hard reset of the kernel without killing the frontend.
This a a common feature request and you can't do it with 1 process
because of how python imports extension code.
* Performance.  Using two processes gives you the possibility of using
2 cores (1 for the kernel, 1 for the frontend) rather than just 1.
* Automatically works over the network.
* Separates the event loop issues of the frontend from those of the
kernel.  You could use wx for plotting in the kernel, but froma Qt
based frontend.
* You can easily do Control-C interrupts in a clean manner.
* Your GUI won't die when you run extension code that holds the GIL.
This is huge!

Bottom line: the two process model is the best possible solution is
almost every case.  We will always have a 1 process version of
IPython, but it will be very limited compared to the 2 process version
eventually.

Cheers,

Brian

> I'm not really sure if this questioning here is explained in the diagram
> that Omar has in the wiki, but it's very important for both of us to clarify
> this soon.
>
> I hope Omar reads this message soon so he can explain better his idea.
>
> Sorry if I'm wrong.
>
>
>
> Best regards.
> --
> Gerardo GutiƩrrez GutiƩrrez
> Physics student
> Universidad de Antioquia
> Computational physics and astrophysics group (FACom)
> Computational science and development branch(FACom-dev)
> Usuario Linux #492295
>
>
>
>



-- 
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com



More information about the IPython-dev mailing list