Kris Warkentin <kewarken@qnx.com> wrote:
“Igor Kovalenko” <> Igor.Kovalenko@motorola.com> > wrote in message
news:abush7$2ou$> 1@inn.qnx.com> …
“Kris Warkentin” <> kewarken@qnx.com> > wrote in message
news:abtjkv$ccb$> 1@nntp.qnx.com> …
“Igor Kovalenko” <> Igor.Kovalenko@motorola.com> > wrote in message
news:absau0$3qf$> 1@inn.qnx.com> …
I don’t think so. Doing mmap(MAP_ANON|MAP_SHARED) before fork() is
perfectly
legal and is actualy the very reason to even have MAP_ANON|MAP_SHARED
combo
(or it would not be usable). Apache works that way, FYI. It is
responsibility of process/memory manager to figure out which pages are
private and which are shared and handle creation of child process
accordingly. For all I know, QNX supports this.
Furthermore, on Unix systems fork() actually does NOT copy memory at
all,
until it is attempted to be written into by either child or parent
(this
is
called Copy-On-Write). QNX does not support this feature.
We’re really careful not to support features that introduce all sorts of
non-determinancy into running applications. > 
That’s a nice face-saving way to say ‘our VM subsystem sucks’ 
You’re not forgetting that application doing fork() is also RUNNING, are
you? If you support COW, then you have ‘best case’ (no pages modified) and
‘worst case’ (all pages modified, which must be bloody rare) scenarios. If
you do not support it then you always have ‘worst case’. One might call
that
‘determinism’, like in ‘deterministically poor performance’.
I disagree. It is much easier to say ‘okay, I’m going to fork now’ at a
non-critical time in your program than to try and predict when some page
might need to be copied.
Help me out with the term “non-critical time in your program” when you are
discussing a system that may contain N processes, each of which determines
it’s own “critical” time?
Perhaps there’s a resource manager that
gets input from all the processes and then notifies the waiting-to-fork
process that it’s “ok now, nobody is expecting an interrupt?” 
Cheers,
-RK
–
Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.