MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: why does not the Mathematica kernel seem to 'multi-task' between computations in different windows?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69866] Re: why does not the Mathematica kernel seem to 'multi-task' between computations in different windows?
  • From: "ben" <benjamin.friedrich at gmail.com>
  • Date: Tue, 26 Sep 2006 00:59:25 -0400 (EDT)
  • References: <ef8206$b8b$1@smc.vnet.net>

Hi,

I suggest to check the manual about the difference between
mathematica frontent (windows) and mathematica kernel (computation
client):

The frontend only displays your worksheet nicely, handles editing and
sends
commands to the kernel; its the kernel that does all the computation
work.

Now the point is: You can open several frontends which
by default will all be linked to the same instance of the kernel.

This has two surprising effects,

1. A kernel which is busy with a command from frontend no.1 is simply
busy, it can not do computations for frontend no.2 in the same time

2. All variables are stored by the kernel, that is a variable defined
in frontend no.1
is visible also in frontend no.2

Effect 2 makes clear why you cannot have multi-tasking: results would
be not defined uniquely, since results from frontend no.2 can effect
the state of the variables and thus computations in frontend no.1 and
vice versa, and if you do not know which of two calculations running
parallel finishes first you might end up in a whole mess.

What's now the solution to your problem?

Kernel->Kernel Configure Options allows you to add additional kernels
(make them local for simplicity)
Then by
Kernel->Notebook's Kernel
you can assign a unique kernel to each notebook.
This will use up extra memory and maybe licences too.

Hope that helps
Ben

Nasser Abbasi schrieb:

> Hi
>
> Sometime I start some computation in one window which can take few minutes
> to half an hour or more.
>
> It seems anything I type meanwhile in a second window does not get processed
> until the first computation is completed.
>
> The computation does have 'Print[]' statements in it for debugging, so it is
> not completely CPU bound, and I would think that one should be able to do
> someone work in the second window meanwhile even if it might be slower to
> respond.
>
> It seems that the Mathematica kernel can't be preempted at all once it
> starts a computation, even if I/O calls are being made.
>
> Right now, once I start something, I can't use Mathematica at all until the
> computation is over because the kernel is busy. (Except it seems I am able
> to do File->Save ok while it is busy)
>
> Sometimes I start a second copy of Mathematica, but the limit is 2 instances
> and I do not have lots of RAM.  I also wonder if this limit should be
> increased to say 5.
>
> I guess it is time for me to go buy a PC with those Intel new chips the
> core2 with lots of RAM as I spend too much time now waiting for something to
> complete.
> 
> Nasser


  • Prev by Date: Re: showing your work in mathematica
  • Next by Date: Re: Re: Locating common subexpressions
  • Previous by thread: Re: Mapping Functions That Take More Than One Argument
  • Next by thread: Re: Re: why does not the Mathematica kernel seem to 'multi-task' between computations in different windows?