From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from apollo.le.ac.uk ([143.210.16.125]) by hawkwind.utcs.utoronto.ca with SMTP id <25165>; Fri, 14 Jan 2000 15:32:36 -0500 Received: from happy.star.le.ac.uk ([143.210.36.58]) by apollo.le.ac.uk with smtp (Exim 3.03 #1) id 1299Wx-0007PG-00 for rc@hawkwind.utcs.toronto.edu; Fri, 14 Jan 2000 16:24:55 +0000 Received: (qmail 13094 invoked from network); 14 Jan 2000 16:25:29 -0000 Received: from ltpcg.star.le.ac.uk (tjg@143.210.36.203) by happy.star.le.ac.uk with SMTP; 14 Jan 2000 16:25:29 -0000 To: Paul Haahr In-Reply-To: Cc: rc@hawkwind.utcs.toronto.edu Subject: Re: Dynamically loading readline on demand (was Re: rc futures) From: Tim Goodwin Message-ID: Date: Fri, 14 Jan 2000 11:26:20 -0500 > > I took an rc script that does nothing (makes no system calls) except > > fork() and wait() 10000 times. > > Are you sure it doesn't exec at all? You tell me. for (i in 0 1 2 3 4 5 6 7 8 9) ... for (m in 0 1 2 3 4 5 6 7 8 9) @{ ~ 0 0 } According to strace on my Linux box, each loop calls fork(), close(), rt_sigaction() twice, _exit(), and wait(). > > ([...] Why does dynamic linking increase the user time? > The short answer is ``because dynamic > linking is done with user-space code.'') Yeah: in crt0. But (I'm sure) that isn't involved here. I'd expect fork() to take more *system* time (since there are more MAP_SHARED page table entries to fiddle with), but I don't understand the increase in user time. > I disagree. Overall system resource consumption still goes down with > dynamic linking and loading. If a system is set up to use dynamic > linking by default, why should rc override that? You're right. I wish you'd stop doing that :-). Forcing static linking down people's throats is Not Nice. Particularly because (at least with the present setup) it's dead easy to turn static linking on, but it would be quite hard to turn it off. (For comparison, see how easy it isn't to turn off `-Wall' if you're using gcc.) I still intend to advocate it in the INSTALL document, though. Tim.