In article <11**********************@g4g2000hsf.googlegroups. com>,
sc*********@hotmail.com <sc*********@hotmail.comwrote:
>One of my collegue at work said that on a 4 CPU server, it's better to
write a program that forks 4 "sub-processes" instead of writing a
single process program (ie : a program that doesn't call fork())
I guess the theory behind this is that each one of the 4 sub-processes
can be processed by a separate CPU, which means that in a ideal
scenario, 4 instructions can be processed "at the same time".
This is reasonable if your program can be decomposed into parts that
can be run simultaneously, without much need to communicate. If they
need to share data, you may find it easier to use multiple threads
inside a single program. How you do this depends on your system;
C itself does not include any thread mechanism.
Bear in mind that other people using the server may be annoyed at your
making full use of it...
-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.