[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pexec mode 4 and 104



(1) Only files that are open at the time of the Pexec can be used by the
child.

(2) Only memory owned by the parent at the time of the Pexec can be used
by the child (in fact it will also be owned by the child). Memory allocated
after the Pexec by the parent or child cannot be used by the other.

(3) As far as GEM is concerned, any new process will be a new application,
so it will need to make an appl_init() before doing GEM calls; otherwise,
the results are unpredictable.

(4) Calling malloc() from the child is unlikely to work as desired, unless
the library has been very, very carefully designed (none that I know of
have been). As you say, the OS Malloc() function (if needed) will be called
from the context of whichever process made the malloc(). Also note that if
two concurrent threads call malloc() at the same time, there is lots of
potential for pointers being screwed up (unless the library protects things
with semaphores; no library does this, so far as I know).