[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: linux & processes
Mike Londarenko writes:
> I wrote about number of processes simultaneosuly handled by Linux on
> different platforms(in one second period) . If I'm not mistaken
> I read this or in Linux kernel hackers guide or in Linux Kernel
> guide by David Rusling . Can you chek this ? This must be or in the
> section describing kernel or in the section describing processes and how are
> they handled .
Context switching is done 100 times a second (by default -- it's a
#define you can change somewhere), but there was a misunderstanding.
The 100 switches are for *running* processes, and there are never 100
processes *running* at the same time on any box. Normally processes
sleep almost all the time, whether it's due to waiting for user events
(interactive programs), network activity (daemons, many interactive
programs), or hardware events. There are rarely more than two
processes running at the same time on your box. Remember that load
average is, among others, the average of the number of processes
running at the same time. So what's your average load average?
Probably not more than 2. 100 programs running at the same time would
result in load average of 100, something pretty much unseen.
So you both are right. Uri is right because you can have much more
than 100 processes on your box, and you are right because you'd be
hosed if you have 100 of them running at the same time.
(Mike, I'm CC'ing this letter to linux-il, hope you don't mind)
--
Alex Shnitman | http://www.debian.org
alexsh@hectic.net, alexsh@linux.org.il +-----------------------
http://alexsh.hectic.net UIN 188956 PGP key on web page
E1 F2 7B 6C A0 31 80 28 63 B8 02 BA 65 C7 8B BA
`When you say "I wrote a program that crashed Windows", people just stare at
you blankly and say "Hey, I got those with the system, *for free*".'
-- Linus Torvalds