SMP Basics. KeyStone Training Multicore Applications Literature Number: SPRPxxx . Questions. What is SMP, what are its advantages How threads are created, how do they share memories. Definition of SMP
Literature Number: SPRPxxx
What is SMP, what are its advantages
How threads are created, how do they share memories
(Symmetric MultiProcessing) A multiprocessing architecture in which multiple CPUs, residing in one cabinet, share the same memory. SMP systems provide scalability. As business increases, additional CPUs can be added to absorb the increased transaction volume.SMP systems range from two to as many as 32 or more processors. However, if one CPU fails, the entire SMP system is down. Clusters of two or more SMP systems can be used to provide high availability (fault resilience). If one SMP system fails, the others continue to operate.
A Pool of ResourcesOne of the CPUs boots the system and loads the SMP operating system, which brings the other CPUs online. There is only one instance of the operating system and one instance of the application in memory. The operating system uses the CPUs as a pool of processing resources, all executing simultaneously, either processing data or in an idle loop waiting to do something.Whatever Can Be OverlappedSMP speeds up the processes that can be overlapped such as running multiple applications simultaneously. If an application is multithreaded, which allows for concurrent operations within the application itself, then SMP can improve the performance of that single application.
A process is created by the operating system to run an application. Starting a process requires a great amount of overhead
A process might have multiple procedures each one is somewhat independent from other procedures. A system that can schedule these procedures in an efficient way is multi-thread system
A thread is defined as an independent stream of instructions that can be scheduled to run as such by the operating system and requires much less overhead than a process
POSIX threads (pthreads) is an IEEE standard that defines portable (between different hardware) threads
Pthreads are defined as a set of C language programming types and procedure calls, implemented with a pthread.h header/include file and a thread library
In terms of performance cost, pthreads require much less resources to be created and managed
All threads within a process share the same address space. Inter-thread communication is more efficient and easier than inter-process communication.
Mutex is an abbreviation for "mutual exclusion" types and procedure calls, implemented with a pthread.h header/include file and a thread library
A mutex variable is a "lock" (a semaphore), protecting access to a shared data resource to prevent “race” conditions
Using MUTEX ensures that when a thread lock a mutex variable, no other thread can access the same variable until the mutex is released
Condition variables behave like flags, they enable synchronization between threads based on variable value but without the needs to explicitly pull the flag value
The thread gives resources to other threads until the condition variable is ready
A condition variable is always used in conjunction with a mutex lock.
Part of the release at
Need to add