# How to use deep clones in Mathematica [closed]

Is there a way to use deep clones in Mathematica?

Maybe by making lots of different kernels. In order to execute multiple notebooks I need more than one kernel, is there a way to make them using C# code?

• What do you mean by "deep clone"? – C. E. Nov 17 '19 at 16:54
• @C.E. I edited my question – Jan Nov 17 '19 at 17:02
• Still not nearly enough info. – Henrik Schumacher Nov 17 '19 at 17:24
• @Jan Notice that you have not addressed the key question here, i.e. what is a "deep clone"? – MarcoB Nov 17 '19 at 20:26

## 1 Answer

If you need to make a variable available for many threads in parallel computing, you should check out DistributeDefinitions.

If you need parallel processing, you should first try built-in parallel functions like ParallelTable before running many copies of the whole Mathematica.

In case you need dedicated kernels called from external software, consider running Wolfram Language scripts (.m files instead of Notebooks .nb) with dedicated kernels invoked from the command line.

If you really need to talk to a live kernel from external applications, there is MathLink.

If by deep clone you just mean to have another independent variable with the same value, then almost all variables in Mathematica can be considered deep copies (you do not need to know how the underlying memory is actually handled for you by the kernel) (an exception is delayed evaluation).