Anders Engle wrote:
> 
> -----
> The REAL problem is with the execution speed. If this program is run on
> a multiprocessor system in the bg, and top is executed, the processes
> only get ~15% of the CPU time, and the system gets a whopping 400% and
> about 385% idle. (* processors - 800%).
> 
> If I use a fork and multiply processes, the CPU is used about 799%, 1%
> system, 0 idle.
> 
> The Question is WHY???? I'm pulling my hair out here! HELP! [I have
> enclosed the source]
> -----
> 
> I've been living under the impression that linux doesn't support kernel
> level threads. Which in this case would mean that the kernel schedules
> your process on ONE cpu (it doesn't know about threads). All the threading
> would then have to be cunducted in userspace and perhaps system calls from
> there can cause the system % to shoot up.

This is plain, dead wrong. See clone(2).

The __clone() call is used to implement both heavyweight and lightweight
(thread) processes. It gives you fine-grained control over exactly which
parts of a process's state are inherited or copied from the parent. I
imagine the pthreads library on Linux implements threads using
__clone().

Maybe he has an out-of-date pthreads library. Linux threads should be
quick quick quick.

Regards,
Scott
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/dmentre/smp-howto/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]

Reply via email to