SMP Basics KeyStone Training Multicore Applications Literature Number: SPRPxxx 1.

Slides:



Advertisements
Similar presentations
Multiple Processor Systems
Advertisements

Threads, SMP, and Microkernels
5.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 5: CPU Scheduling.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Computer Systems/Operating Systems - Class 8
1 Threads, SMP, and Microkernels Chapter 4. 2 Process: Some Info. Motivation for threads! Two fundamental aspects of a “process”: Resource ownership Scheduling.
Based on Silberschatz, Galvin and Gagne  2009 Threads Definition and motivation Multithreading Models Threading Issues Examples.
SMP threads an Introduction to Posix Threads. Technical Definition 1.Independent stream of instructions that can be scheduled to run by an operating system.
Operating Systems CS208. What is Operating System? It is a program. It is the first piece of software to run after the system boots. It coordinates the.
Processes Part I Processes & Threads* *Referred to slides by Dr. Sanjeev Setia at George Mason University Chapter 3.
Computer System Architectures Computer System Software
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Lecture 4: Parallel Programming Models. Parallel Programming Models Parallel Programming Models: Data parallelism / Task parallelism Explicit parallelism.
Multithreaded Web Server.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads.
Chapter 4 MultiThreaded Programming. 2015/9/18os Outline Overview Multithreading Models Threading Issues Pthreads Solaris 2 Threads Windows XP/2000.
Multiple Processor Systems. Multiprocessor Systems Continuous need for faster and powerful computers –shared memory model ( access nsec) –message passing.
Understanding Operating Systems Fifth Edition Chapter 6 Concurrent Processes.
Operating System 4 THREADS, SMP AND MICROKERNELS
Threads, Thread management & Resource Management.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Threads in Java. History  Process is a program in execution  Has stack/heap memory  Has a program counter  Multiuser operating systems since the sixties.
Processes and OS basics. RHS – SOC 2 OS Basics An Operating System (OS) is essentially an abstraction of a computer As a user or programmer, I do not.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Understanding Operating Systems 1 Chapter 6 : Concurrent Processes What is Parallel Processing? Typical Multiprocessing Configurations Process Synchronization.
Multiprocessor and Real-Time Scheduling Chapter 10.
Chapter 101 Multiprocessor and Real- Time Scheduling Chapter 10.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Games Development 2 Concurrent Programming CO3301 Week 9.
POSIX Threads Programming Operating Systems. Processes and Threads In shared memory multiprocessor architectures, such as SMPs, threads can be used to.
Multiple Processor Systems. Multiprocessor Systems Continuous need for faster computers –shared memory model ( access nsec) –message passing multiprocessor.
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
1 Threads, SMP, and Microkernels Chapter 4. 2 Process Resource ownership: process includes a virtual address space to hold the process image (fig 3.16)
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Chapter 4: Threads Overview Multithreading.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
Professor: Shu-Ching Chen TA: Samira Pouyanfar.  An independent stream of instructions that can be scheduled to run  A path of execution int a, b; int.
1 Pthread Programming CIS450 Winter 2003 Professor Jinhua Guo.
Operating System 4 THREADS, SMP AND MICROKERNELS.
CS 838: Pervasive Parallelism Introduction to pthreads Copyright 2005 Mark D. Hill University of Wisconsin-Madison Slides are derived from online references.
CIS250 OPERATING SYSTEMS Chapter One Introduction.
Copyright © Curt Hill Concurrent Execution An Overview for Database.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
NCHU System & Network Lab Lab #6 Thread Management Operating System Lab.
1/46 PARALLEL SOFTWARE ( SECTION 2.4). 2/46 The burden is on software From now on… In shared memory programs: Start a single process and fork threads.
Operating System Concepts
Page 1 2P13 Week 1. Page 2 Page 3 Page 4 Page 5.
Chapter 4: Threads 羅習五. Chapter 4: Threads Motivation and Overview Multithreading Models Threading Issues Examples – Pthreads – Windows XP Threads – Linux.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
Chapter 4: Multithreaded Programming
Introduction to Parallel Processing
Multithreading Tutorial
Computer Engg, IIT(BHU)
Chapter 4: Threads.
Threads, SMP, and Microkernels
Symmetric Multiprocessing (SMP)
Multithreading Tutorial
Lecture 4- Threads, SMP, and Microkernels
Operating System 4 THREADS, SMP AND MICROKERNELS
Multiprocessor and Real-Time Scheduling
Concurrency: Mutual Exclusion and Process Synchronization
Multithreading Tutorial
Programming with Shared Memory
Multithreading Tutorial
Programming with Shared Memory
- When you approach operating system concepts there might be several confusing terms that may look similar but in fact refer to different concepts:  multiprogramming, multiprocessing, multitasking,
Operating System Overview
Presentation transcript:

SMP Basics KeyStone Training Multicore Applications Literature Number: SPRPxxx 1

Definition 2 Symmetric MultiProcessing (SMP): 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.

SMP Work 3 A Pool of Resources One 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 an 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. Speed Up SMP 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.

SMP High Points A single operating system An application can be distributed between multiple cores Memories can be global to all threads or local to each thread Pthreads provide the parallelism 4

Threads 5 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 6 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.

Parallel pthreads 7 Several common models for threaded programs exist: Master/slaves: a single thread, the master assigns work to other threads, the slaves. Typically, the master handles all input and parcels out work to the other tasks. At least two forms of the master/slaves model are common: static slaves pool and dynamic slaves pool. Pipeline: a task is broken into a series of sub-operations, each of which is handled in series, but concurrently, by a different thread. An automobile assembly line best describes this model. Peer: similar to the master/slave model, but after the main thread creates other threads, it participates in the work.

Memory Model 8 All threads have access to the same global, shared memory. Threads also have their own private data. Programmers are responsible for synchronizing access (protecting) globally shared data.

Memory Protection MUTEX 9 Mutex is an abbreviation for "mutual exclusion.“ 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 10 Condition variables behave like flags, they enable synchronization between threads based on variable value but without the need to explicitly pull the flag value. The thread gives resources to other threads until the condition variable is ready. To prevent race condition (when two threads try to access the same conditional variable at the same time), a condition variable is always used in conjunction with a mutex lock.

SMP Demo In MCSDK Release 11 Part of the release at: MCSDK_3_15\mcsdk_linux_3_00_03_15\example-applications\smp_test Need to add: #include