On Fri, Feb 27, 2009 at 8:47 AM, Søren Hauberg <so...@hauberg.org> wrote:
> fre, 27 02 2009 kl. 14:03 +0100, skrev Jaroslav Hajek:
> > in case anyone is interested, I committed today into the "general"
> > package an initial m-file implementation of parcellfun.
> > parcellfun is supposed to be able to evaluate a given function for
> > multiple sets of input arguments using multiple processes.
>
> Just out of ignorance: doesn't this require that Octave is thread-safe?
>
No, since fork() spawns a separate process, and communication is done via
pipes. Threads within the same process have access to (and can trample)
each other's resources; hence the need for being "thread-safe." Processes
do not have access to each other's resources. The one exception is that a
forked process has access to its parent's open filehandles, including pipe
handles. But if the parent and child used the pipe incorrectly, they just
wouldn't communicate; they would not, for instance, ruin each other's data
like threads could do. In fact, the operating system won't even let them
directly access each other's data.
I hope my explanation sums it up well. If you're new to the idea and want
to learn more, you could Google "process vs. thread" or "fork vs. thread" or
something similar.
Joe V.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev