David Korn wrote: > ksh93 needs to call whatever is the fastest method for creating a process. > To do this, ksh93 calls a wrapper function named spawnveg() that is in the > ast library. This function combines fork/exec plus specifies the process > group to join or whether to create a new group or not. > > This function uses the fastest method available. The iffe (IF Feature Exists) > script, which runs at compile time, compares the performance of vfork() > and posix_spawn() if both exists and chooses the fastest. > > Since ksh93 doesn't use threads. I am not aware of any reason > that vfork() would not be reliable.
The problem is that the Solaris 10 version of |libc::vfork()| (the public function, not the internal |_vfork()|) is 100% identical to |fork()|. AFAIK all consumers who previously used the |vfork();exec()|-sequence should now use |posix_spawn()| instead (otherwise some performance gets lost). Another problem is that we'd like to make libshell threadsafe (yes, I know, things like the process's current working directory still need something like a "global lock") in the future and this issue may then really hurt (ksh93/libdll uses the dynamic linker for builtins) ... ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;)