Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2001 10:09:28 +1100
From:      Peter Jeremy <peter.jeremy@alcatel.com.au>
To:        Andrzej Bialecki <abial@webgiro.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: number of processes forked since boot
Message-ID:  <20010116100928.H91029@gsmx07.alcatel.com.au>
In-Reply-To: <Pine.BSF.4.20.0101152321530.13323-100000@mx.webgiro.com>; from abial@webgiro.com on Mon, Jan 15, 2001 at 11:24:22PM %2B0100
References:  <20010116.025742.74757685.ume@FreeBSD.org> <Pine.BSF.4.20.0101152321530.13323-100000@mx.webgiro.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2001-Jan-15 23:24:22 +0100, Andrzej Bialecki <abial@webgiro.com> wrote:
>On Tue, 16 Jan 2001, Hajimu UMEMOTO wrote:
...
>> +static unsigned int nforks = 0;
>> +SYSCTL_UINT(_kern, KERN_NFORKS, nforks, CTLFLAG_RD, &nforks, 0, "");
>
>If any, I think this should be long, otherwise on machines like web
>servers the counter will overflow in a short time.

On an i386, "long" and "int" are both 32 bits, hence "long" has a
lower maximum count than "unsigned int".  "unsigned long" might be
a better choice (to give a greater range on the Alpha).

In any case, at 1000 forks/sec, a 32-bit counter will still take
nearly 50 days to wrap.  Lots of other counters will have wrapped
by this time.

Peter


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010116100928.H91029>