From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Tue, 24 Feb 2009 10:54:43 -0500 To: ben@flyingwalrus.net, 9fans@9fans.net MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Calling vac from C Topicbox-Message-UUID: a7a13c84-ead4-11e9-9d60-3106f5b1d025 > 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