> about 5 years ago i took a class on performance tuning Solaris. > > The instructor claimed that fork was expensive because accounting is never > really turned off, just piped to /dev/null. there is no accounting overhead > for threads. > > I never bothered to verify this, but now that this comes up, I'd tempted.
there's no need to guess. here's the source code. http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/os/fork.c cfork is ~525 lines long and seems to take the curious tack of forking all the lwps associated with a process. i don't see any accounting, but i see at least 9 + nlwp + nresourcectls mutex locks if you follow the regular fork path. what is the accounting that you're thinking of? it would be easy to miss. - erik