OperatorGK wrote:I think I'll use doskey to set up a communication link to the parent
How
? Can you please write the code? And will it work parallel?
I define macro's in delayed expansion, the advantage is that macro's can be used inside other macro's. When a change needs to be made only a single macro needs to change, it affects all other macro's where it is embedded.
The disadvantage is that a nested macro takes a parameter and produces a result like a function. This is not as efficient as if the macro was not embedded at all and it's body is used directly as then you don't need to pass it any parameter.
Dbenham's macro's you see on the forum are defined with delayedExpansion disabled. The advantage is that he can post a macro and it will work because with delayedExpansion disabled it is not possible to nest macro's. The downside is that there is no longer a single point of definition. And the body needs to be updated everywhere it occurs.
I could post the code, but if I do that I would also need to post all macro's it uses, and because most of them have other macro's embedded. I would need to post my entire library which is unpractical.
Doskey based communication between a parent and it's child processes is described in detail here, and using doskey is quite straightforward. You will need to encode your variables for doskey as it does not accept all characters.
http://www.dostips.com/forum/viewtopic.php?f=3&t=1937.
OperatorGK wrote:Also, for WHAT you need such a parallel scripting? Only file I/O heavy tasks like AES ciphering/ MD5 hashing require it.
For heavy tasks that lend themselves for parallelism yes. For the moment I use parallelism only for caching macro's to disk. Caching a macro involves a lot of math; special characters need to be escaped, tokens need to be protected and the cached file needs to be written out twice. One version that should be loaded with delayedExpansion enabled and another for loading with delayedExpansion disabled.
When the [parent] caching function detects a cached macro is different from it's definition due to an update, it places the macroName and macroValue in doskey memory. Another parallel [child] instance checks doskey for macroNames to be recached. It will keep doing this until it encounters a quit entry.