Wed 04 May 2016 04:53:48 PM UTC, comment #5:
> Is there some other method that could be used on Windows
> (or all) systems to make parcellfun work without having to
> use fork?
I can't imagine how the functionality of parcellfun could be achieved with threads.
The complicated hack to start new Octave instances with system() and to use named pipes for data transfer would leave considerable issues with passing of parameters and functions.
So I see no alternative to fork here.
> What would you do in C++ code to make parcellfun work
> on Windows systems without using fork?
If it's decided to leave this problem to the parallel package, I'd probably try to make an oct-function which wraps fork, if possible, and calls something different (CreateProcess?) if fork is not present. I'd probably look at the way Cygwin does the latter.
Mmh... probably this will be difficult, and some say Cygwin has a leaky solution for this:
http://stackoverflow.com/questions/985281/what-is-the-closest-thing-windows-has-to-fork
And now it occurs to me that there may be an additional problem for parcellfun: it nees the Unix
function in the child processes, and I don't know a Windows pendant. Maybe Octave could be pursued to exit without calling functions registered with atexit(), then there would be no need for
...
So currently I don't know if there will be a feasible solution for parcellfun on MINGW at all. Maybe it is better to try a solution in the parallel package first, including the issue with exit(). If it turns out there is a clean solution for fork, something similar could be done in Octave.
|