2
$\begingroup$

So I have a server running in another notebook with a secondary kernel. I run my main notebook and launch the server notebook, but I have configured the variables in my main one, and can't find a way to send variables from one to another. I already tried something like:

ServerPort = 5000;
SetSharedVariable[ServerPort];

Then in another notebook:

%SharedVariables
{}

as you see there is nothing.

Another way to solve my problem would be to pass parameters between one and the other, I open the second one like this:

NotebookOpen[FileNameJoin[{Directory[], "server.nb"}];

Thanks in advance for your help, I already googled and found no related content, that is why I ask it to you.

$\endgroup$
  • $\begingroup$ Can you clarify what you mean bei "a server running in another notebook"? $\endgroup$ – sebhofer Nov 29 '15 at 22:20
  • $\begingroup$ I mean that I use a notebook to run something apart, say a server, so it needs to be in another kernel because it will be always running. $\endgroup$ – jaimehrubiks Nov 29 '15 at 23:37
  • $\begingroup$ Are both kernels running on the same machine? $\endgroup$ – Edmund Nov 30 '15 at 0:21
  • $\begingroup$ Yes, they are. But I must do it o different notebooks since the commands that i need to use are not compatible with Parallelize[] or ParallelEvaluate[] or any other $\endgroup$ – jaimehrubiks Nov 30 '15 at 8:11
  • $\begingroup$ Well that's not how parallel evaluation works in Mathematica, see here $\endgroup$ – sebhofer Nov 30 '15 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.