Nicolas, I know that posix_spawn exists now in Solaris. But I measured that it has no benefit over the traditional vfork and exec sequence of calls, but the authors of posix_spawn designed it to be an improvement if *implemented* in the kernel. The lack of performance difference between posix_spawn and vfork,exec and the *very* bad performance of vfork,exec on Solaris - compared to Linux on the same hardware, where 2.6.25.20-0.5-default can spawn utilities al most 70% faster than Opensolaris B134 - has lead to my request to find some one to try and improve the situation.
Olga 2010/7/14 Nicolas Williams <nicolas.willi...@oracle.com>: > On Wed, Jul 14, 2010 at 01:50:39AM +0200, ольга крыжановская wrote: >> My concern is not threading, not yet, until ksh93's multi thread >> support lands in Solaris. >> My concern is that fork and exec do double work or fork does jobs >> which are then un done by exec again, but I can only speak for the BSD >> implementation of fork and exec, not Solaris. >> A posix_spawn system call would eliminate much of this madness. > > Olga, > > posix_spawn(3C) exists _now_ in Solaris, and it uses vforkx(2). > > vforkx(2), like vfork(2), doesn't copy/COW the parent's address space, > but it does have to stop the parent's threads as a trade-off. The > address space COW/copy of traditional fork is almost certainly the most > expensive part of forking, which is precisely why posix_spawn(3C) uses > vforkx(2) under the covers. > > A posix_spawn(2) system call would be able to save only the work of > stopping, and subsequently resuming the parent process' threads, and a > few syscall traps for the fcntl(2) and a few other system calls that > posix_spawn(3C) has to make. > > The question is: is there a real problem here? Or is this just an > imperfection that has caught your eyes but which might not actually be a > real problem? > > Again, I could see that Java apps, Firefox and a handful of other > applications could benefit from a posix_spawn(2), but I suspect these > apps spawn children rarely enough that a user-land posix_spawn() is not > a problem. > > My advice is: worry about real problems. > > Nico > -- > -- , _ _ , { \/`o;====- Olga Kryzhanovska -====;o`\/ } .----'-/`-/ olga.kryzhanov...@gmail.com \-`\-'----. `'-..-| / http://twitter.com/fleyta \ |-..-'` /\/\ Solaris/BSD//C/C++ programmer /\/\ `--` `--` _______________________________________________ perf-discuss mailing list perf-discuss@opensolaris.org