[TriLUG] Questions about Threading

M. Mueller at Signalnetware.com mmueller at signalnetware.com
Tue Mar 26 12:55:36 EST 2002


On Tuesday 26 March 2002 12:08 pm, you wrote:
> I'm not a programmer, but I am curious about threading and the advantage
> to having a multi-processor linux box (I guess running an smp kernel).
> Do programs have to be written to take advantage of a dual-processor, or
> will cycles be distributed evenly during a process?  How do you know if
> your program will support multiple processors?

The kernel can use multiple processors to run more than one single threaded 
program.

A program can be composed of:
process 	threads 
---------------------------
single		single
single		multiple
mutiple		single || multiple

Programs that are multi-process, multi-threaded might run faster in a 
multi-processor environment.  A programmer could write a multi-process, 
multi-thread operation that passes a semephore that allows execution only 
with possesion of the semaphore, thus rendering multi-processors to be of 
less value to such an application.

In general, it pays to understand the kernel scheduling function and design a 
program to take advantage of that algorithm.

Running a web server with multiple processes could probably be improved using 
a multiple processor server.

My application would be helped significantly by having multiple processors, 
one for each of 5 daemons that run in parallel and perform independent tasks 
and use IPC to talk to each other.  In this case, the vendor tells you 
outrightly that the multiple processor machine will improve performance.

-- 
Michael Mueller
Signalnetware, Inc.
www.signalnetware.com
919.621.6090
Converged network solutions using open source tools



More information about the TriLUG mailing list