On Fri, Jul 25, 2008 at 1:43 PM, Simon Beaumont <[EMAIL PROTECTED]> wrote:
>
> Can someone please outline for me the process/thread structure of the
> sage workbook server - given multiple connections (user sessions) and
> multiple concurrent notebooks and the degree of scope sharing - I did
> think that each notebook had its own python process but this is
> mistaken - how is context (variable scope and extent) shared?

You're right actually -- every single worksheet process is run in its
own copy of Python.  This copy of Python is controlled asynchronously
via pexpect.  It's started up via the code in
             devel/sage/sage/server/notebook/worksheet.py
Look at the top there.

There is also an experimental mode you can set the notebook to
(by changing the variable multisession in worksheet.py) so that all
worksheet share exactly the same Python process -- same variables,
etc., -- like Mathematica does.

>  This is
> really important if I am to understand how the CUDA device can be
> timeshared. I do have multiple notebooks sharing the device (with
> initialisation occurring once in the worksheet it would appear). What
> does it mean to restart the worksheet?

The pexpect spawned python process where computations occur
is quit when you click "restart worksheet".

> It would help me a lot if I had
> a better understanding of sage architecture. Meanwhile I'm back to the
> CUDA docs.

Please continue to ask questions!

William

>
> Thanks,
>
> Simon
>
>
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to