CHAPTER 4 - MULTITHREADED PROGRAMMING
|
|
- Hugh Bryan
- 7 years ago
- Views:
Transcription
1 CHAPTER 4 - MULTITHREADED PROGRAMMING
2 OBJECTIVES Introduce notion of thread a fundamental unit of CPU utilization forms the basis of multithreaded computer systems Discuss the APIs for the Pthreads, Windows, and Java thread libraries Explore several strategies that provide implicit threading Examine issues related to multithreaded programming OS support for threads in Windows and Linux 1
3 OVERVIEW 3. 12
4 MOTIVATION Most modern applications are multithreaded Threads run within application Multiple tasks with the application can be implemented by separate threads Update display Fetch data Spell checking Answer a network request
5 MOTIVATION Process creation is heavy-weight while thread creation is light-weight Can simplify code, increase efficiency Kernels are generally multithreaded 3. 2
6 THREAD Basic unit of computation Thread ID Program counter Register set Stack Shares Shares code, data, OS resources with other threads 3. 3
7 SINGLE AND MULTITHREADED PROCESSES 3. 4
8 MULTITHREADED SERVER ARCHITECTURE 3. 5
9 BENEFITS Responsiveness may allow continued execution if part of process is blocked, especially important for user interfaces Resource Sharing threads share resources of process, easier than shared memory or message passing Economy cheaper than process creation, thread switching lower overhead than context switching Scalability process can take advantage of multiprocessor architectures 3. 6
10 MULTICORE PROGRAMMING
11 MULTICORE PROGRAMMING Multicore or multiprocessor systems putting pressure on programmers, challenges include: Dividing activities Balance Data splitting Data dependency Testing and debugging
12 PARALLELISM VS CONCURRENCY Parallelism implies a system can perform more than one task simultaneously Concurrency supports more than one task making progress Single processor / core, scheduler providing concurrency 4. 2
13 PARALLELISM VS CONCURRENCY Concurrent execution on single-core system: Parallelism on a multi-core system: 4. 3
14 TYPES OF PARALLELISM Data parallelism distributes subsets of the same data across multiple cores, same operation on each Task parallelism distributing threads across cores, each thread performing unique operation As # of threads grows, so does architectural support for threading CPUs have cores as well as hardware threads Consider Oracle SPARC T4 with 8 cores, and 8 hardware threads per core 4. 4
15 AMDAHL S LAW Identifies performance gains from adding additional cores to an application that has both serial and parallel components S is serial portion N processing cores 4. 5
16 AMDAHL S LAW If application is 75% parallel / 25% serial, moving from 1 to 2 cores results in speedup of 1.6 times As N approaches infinity, speedup approaches 1 / S Serial portion of an application has disproportionate effect on performance gained by adding additional cores But does the law take into account contemporary multicore systems? 4. 6
17 MULTITHREADING MODELS
18 USER THREADS User threads - management done by user-level threads library Three primary thread libraries: POSIX Pthreads Win32 threads Java threads
19 KERNEL THREADS Kernel threads - Supported by the Kernel Examples virtually all general purpose operating systems, including: Windows Solaris Linux Tru64 UNIX Mac OS X 5. 2
20 MULTITHREADING MODELS Many-to-One One-to-One Many-to-Many 5. 34
21 MANY-TO-ONE
22 MANY-TO-ONE Many user-level threads mapped to single kernel thread One thread blocking causes all to block Multiple threads may not run in parallel on muticore system because only one may be in kernel at a time Few systems currently use this model Examples: Solaris Green Threads GNU Portable Threads 5. 5
23 ONE-TO-ONE 5. 67
24 ONE-TO-ONE Each user-level thread maps to kernel thread Creating a user-level thread creates a kernel thread More concurrency than many-to-one Number of threads per process sometimes restricted due to overhead Examples Windows NT/XP/2000 Linux Solaris 9 and later
25 MANY-TO-MANY 5. 8
26 MANY-TO-MANY Allows many user level threads to be mapped to many kernel threads Allows the operating system to create a sufficient number of kernel threads Solaris prior to version 9 Windows NT/2000 with the ThreadFiber package 5. 9
27 TWO-LEVEL MODEL 5. 10
28 TWO-LEVEL MODEL Similar to M:M, except that it allows a user thread to be bound to kernel thread Examples IRIX HP-UX Tru64 UNIX Solaris 8 and earlier 5. 11
29 THREAD LIBRARIES
30 THREAD LIBRARIES Thread library provides programmer with API for creating and managing threads Two primary ways of implementing Library entirely in user space Kernel-level library supported by the OS
31 PTHREADS May be provided either as user-level or kernel-level A POSIX standard (IEEE c) API for thread creation and synchronization Specification, not implementation API specifies behavior of the thread library, implementation is up to development of the library Common in UNIX operating systems (Solaris, Linux, Mac OS X) 6. 2
32 PTHREADS EXAMPLE # i n c l u d e < p t h r e a d. h > # i n c l u d e < s t d i o. h > i n t s u m ; / * t h i s d a t a i s s h a r e d b y t h e t h r e a d ( s ) * / v o i d * r u n n e r ( v o i d * p a r a m ) ; / * t h r e a d s c a l l t h i s f u n c t i o n * / i n t m a i n ( i n t a r g c, c h a r * a r g v [ ] ) { p t h r e a d _ t t i d ; / * t h e t h r e a d i d e n t i f i e r * / p t h r e a d _ a t t r _ t a t t r ; / * s e t o f t h r e a d a t t r i b u t e s * / i f ( a r g c! = 2 ) { f p r i n t f ( s t d e r r, " u s a g e : a. o u t < i n t e g e r v a l u e > \ n " ) ; r e t u r n - 1 ; } i f ( a t o i ( a r g v [ 1 ] ) < 0 ) { f p r i n t f ( s t d e r r, " % d m u s t b e > = 0 \ n ", a t o i ( a r g v [ 1 ] ) ) ; r e t u r n - 1 ; 6. 3
33 PTHREADS CODE FOR JOINING 10 THREADS # d e f i n e N U M T H R E A D S 1 0 / * a n a r r a y o f t h r e a d s t o b e j o i n e d u p o n * / p t h r e a d _ t w o r k e r s [ N U M T H R E A D S ] ; f o r ( i n t i = 0 ; i < N U M T H R E A D S ; i + + ) { p t h r e a d _ j o i n ( w o r k e r s [ i ], N U L L ) ; } 6. 4
34 WIN API MULTITHREADED # i n c l u d e < w i n d o w s. h > # i n c l u d e < s t d i o. h > D W O R D S u m ; / * d a t a i s s h a r e d b y t h e t h r e a d ( s ) * / / * t h e t h r e a d r u n s i n t h i s s e p a r a t e f u n c t i o n * / D W O R D _ W I N A P I S u m m a t i o n ( L P V O I D P a r a m ) { D W O R D _ U p p e r = * ( D W O R D * ) P a r a m ; f o r ( D W O R D i = 0 ; i < = U p p e r ; i + + ) { S u m + = i ; } r e t u r n 0 ; } i n t m a i n ( i n t a r g c, c h a r * a r g v [ ] ) { D W O R D T h r e a d I d ; H A N D L E T h r e a d H a n d l e ; i n t P a r a m ; i f ( a r g c! = 2 ) { 6. 5
35 JAVA THREADS Java threads are managed by the JVM Typically implemented using the threads model provided by underlying OS Java threads may be created by: Extending Thread class Implementing the Runnable interface p u b l i c i n t e r f a c e R u n n a b l e { p u b l i c a b s t r a c t v o i d r u n ( ) ; } 6. 6
36 JAVA MULTITHREADED PROGRAM c l a s s S u m { p r i v a t e i n t s u m ; p u b l i c i n t g e t S u m ( ) { r e t u r n s u m ; } p u b l i c v o i d s e t S u m ( i n t s u m ) { t h i s. s u m = s u m ; } } 6. 78
37 JAVA MULTITHREADED PROGRAM c l a s s S u m m a t i o n i m p l e m e n t s R u n n a b l e { p r i v a t e i n t u p p e r ; p r i v a t e S u m s u m V a l u e ; p u b l i c S u m m a t i o n ( i n t u p p e r, S u m s u m V a l u e ) { t h i s. u p p e r = u p p e r ; t h i s. s u m V a l u e = s u m V a l u e ; } p u b l i c v o i d r u n ( ) { i n t s u m = 0 ; f o r ( i n t i = 0 ; i < = u p p e r ; i + + ) s u m + = i ; s u m V a l u e. s e t S u m ( s u m ) ; } }
38 JAVA MULTITHREADED PROGRAM p u b l i c c l a s s D r i v e r { p u b l i c s t a t i c v o i d m a i n ( S t r i n g [ ] a r g s ) { i f ( a r g s. l e n g t h > 0 ) { i f ( I n t e g e r. p a r s e I n t ( a r g s [ 0 ] ) < 0 ) { S y s t e m. e r r. p r i n t l n ( a r g s [ 0 ] + " m u s t b e > = 0. " ) ; } e l s e { S u m s u m O b j e c t = n e w S u m ( ) ; i n t u p p e r = I n t e g e r. p a r s e I n t ( a r g s [ 0 ] ) ; T h r e a d t h r d = n e w T h r e a d ( n e w S u m m a t i o n ( u p p e r, s u m O b j e c t ) ) ; t h r d. s t a r t ( ) ; t r y { t h r d. j o i n ( ) ; S y s t e m. o u t. p r i n t l n ( " T h e s u m o f " + u p p e r + " i s " + s u m O b j e c t. g e t } c a t c h ( I n t e r r u p t e d E x c e p t i o n i e ) { } } } e l s e { S y s t e m. e r r. p r i n t l n ( " U s a g e : S u m m a t i o n < i n t e g e r v a l u e > " ) ; 6. 9
39 IMPLICIT THREADING
40 IMPLICIT THREADING Growing in popularity as numbers of threads increase, program correctness more difficult with explicit threads Creation and management of threads done by compilers and run-time libraries rather than programmers 7. 2
41 IMPLICIT THREADING Three methods explored Thread Pools OpenMP Grand Central Dispatch Other methods include Microsoft Threading Building Blocks (TBB), java.util.concurrentpackage
42 THREAD POOLS Create a number of threads in a pool where they await work Advantages: Usually slightly faster to service a request with an existing thread than create a new thread Allows the number of threads in the application(s) to be bound to the size of the pool Separating task to be performed from mechanics of creating task allows different strategies for running task i.e. Tasks could be scheduled to run periodically 7. 3
43 THREAD POOLS Windows API supports thread pools: D W O R D W I N A P I P o o l F u n c t i o n ( A V O I D P a r a m ) { / * * T h i s f u n c t i o n r u n s a s a s e p a r a t e t h r e a d * / } 7. 45
44 GPARS i m p o r t s t a t i c g r o o v y x. g p a r s. G P a r s P o o l / / C a l c u l a t e t h e n ' t h f i b o n a c c i n u m b e r d e f f i b o n n a c c i ( n ) { i f ( n < 2 ) { r e t u r n 1 } f i b o n n a c c i ( n - 1 ) + f i b o n n a c c i ( n - 2 ) } G P a r s P o o l. w i t h P o o l { ( ). e a c h P a r a l l e l { i n t i - > d e f t I d = T h r e a d. c u r r e n t T h r e a d ( ). g e t I d ( ) p r i n t l n " $ { i } f i b n u m b e r : $ { f i b o n n a c c i ( i ) } $ { t I d } " } }
45 OPENMP Set of compiler directives and an API for C, C++, FORTRAN Provides support for parallel programming in sharedmemory environments Identifies parallel regions blocks of code that can run in parallel 7. 6
46 OPENMP EXAMPLE # i n c l u d e < o m p. h > # i n c l u d e < s t d i o. h > / / C o m p i l e u s i n g : / / g c c - f o p e n m p o m p. c i n t m a i n ( i n t a r g c, c h a r * a r g v [ ] ) { } # p r a g m a o m p p a r a l l e l { p r i n t f ( " I a m a p a r a l l e l r e g i o n. \ n " ) ; } r e t u r n 0 ; 7. 7
47 OPENMP EXAMPLE # i n c l u d e < o m p. h > # i n c l u d e < s t d i o. h > / / C o m p i l e u s i n g : / / g c c - f o p e n m p o m p 2. c i n t m a i n ( i n t a r g c, c h a r * a r g v [ ] ) { i n t i ; } # p r a g m a o m p p a r a l l e l f o r f o r ( i = 0 ; i < 2 0 ; i + + ) { p r i n t f ( " I a m a p a r a l l e l f o r l o o p : % i. \ n ", i ) ; } r e t u r n 0 ; 7. 8
48 GRAND CENTRAL DISPATCH Apple technology for Mac OS X and ios operating systems Extensions to C, C++ languages, API, and run-time library Allows identification of parallel sections Manages most of the details of threading Block is in "^{ }" ˆ{ printf("i am a block"); } Blocks placed in dispatch queue Assigned to available thread in thread pool when removed from queue 7. 9
49 GRAND CENTRAL DISPATCH Two types of dispatch queues: serial blocks removed in FIFO order, queue is per process, called main queue Programmers can create additional serial queues within program concurrent removed in FIFO order but several may be removed at a time three system wide queues with priorities low, default, high 7. 10
50 THREADING ISSUES
51 THREADING ISSUES Semantics of fork()and exec()system calls Signal handling Synchronous and asynchronous Thread cancellation of target thread Asynchronous or deferred Thread-local storage Scheduler Activations
52 SEMANTICS Semantics of fork()and exec() Does fork()duplicate only the calling thread or all threads? Some UNIXes have two versions of fork Exec()usually works as normal replace the running process including all threads 8. 2
53 SIGNAL HANDLING Signals are used in UNIX systems to notify a process that a particular event has occurred. A signal handler is used to process signals 1. Signal is generated by particular event 2. Signal is delivered to a process 3. Signal is handled by one of two signal handlers: 1. default 2. user-defined 8. 3
54 SIGNAL HANDLING Every signal has default handler that kernel runs when handling signal User-defined signal handler can override default For single-threaded, signal delivered to process 8. 4
55 SIGNAL HANDLING Where should a signal be delivered for multi-threaded? Deliver the signal to the thread to which the signal applies Deliver the signal to every thread in the process Deliver the signal to certain threads in the process Assign a specific thread to receive all signals for the process 8. 5
56 THREAD CANCELLATION Terminating a thread before it has finished Thread to be canceled is target thread Two general approaches: Asynchronous cancellation terminates the target thread immediately Deferred cancellation allows the target thread to periodically check if it should be cancelled 8. 6
57 THREAD CANCELLATION Pthread code to create and cancel a thread: p t h r e a d _ t t i d ; / * C r e a t e t h e t h r e a d * / p t h r e a d _ c r e a t e ( & t i d, 0, w o r k e r, N U L L ) ;... / * C a n c e l t h e t h r e a d * / p t h r e a d _ c a n c e l ( t i d ) ; 8. 7
58 THREAD CANCELLATION Invoking thread cancellation requests cancellation, but actual cancellation depends on thread state 8. 8
59 THREAD CANCELLATION If thread has cancellation disabled, cancellation remains pending until thread enables it Default type is deferred Cancellation only occurs when thread reaches cancellation point I.e. pthread_testcancel() Then cleanup handler is invoked On Linux systems, thread cancellation is handled through signals 8. 9
60 THREAD-LOCAL STORAGE Thread-local storage (TLS) allows each thread to have its own copy of data Useful when you do not have control over the thread creation process (i.e., when using a thread pool)
61 THREAD-LOCAL STORAGE Different from local variables Local variables visible only during single function invocation TLS visible across function invocations Similar to static data TLS is unique to each thread
62 SCHEDULER ACTIVATIONS Both M:M and Two-level models require communication to maintain the appropriate number of kernel threads allocated to the application Typically use an intermediate data structure between user and kernel threads lightweight process (LWP) Appears to be a virtual processor on which process can schedule user thread to run Each LWP attached to kernel thread How many LWPs to create? 8. 12
63 SCHEDULER ACTIVATIONS 8. 13
64 SCHEDULER ACTIVATIONS Scheduler activations provide upcalls - a communication mechanism from the kernel to the upcall handler in the thread library This communication allows an application to maintain the correct number kernel threads 8. 14
65 OPERATING SYSTEM EXAMPLES
66 OPERATING SYSTEM EXAMPLES Windows XP Threads Linux Thread 9. 2
67 WINDOWS THREADS Windows implements the Windows API primary API for Win 98, Win NT, Win 2000, Win XP, and Win 7 Implements the one-to-one mapping, kernel-level 9. 3
68 WINDOWS THREADS Each thread contains A thread id Register set representing state of processor Separate user and kernel stacks for when thread runs in user mode or kernel mode Private data storage area used by run-time libraries and dynamic link libraries (DLLs) The register set, stacks, and private storage area are known as the context of the thread
69 WINDOWS THREADS The primary data structures of a thread include: ETHREAD (executive thread block) includes pointer to process to which thread belongs and to KTHREAD, in kernel space KTHREAD (kernel thread block) scheduling and synchronization info, kernel-mode stack, pointer to TEB, in kernel space TEB (thread environment block) thread id, user-mode stack, thread-local storage, in user space 9. 4
70 WIN XP THREADS DATA STRUCTURES 9. 5
71 LINUX THREADS Linux refers to them as tasks rather than threads Thread creation is done through clone()system call 9. 67
72 LINUX THREADS clone()allows a child task to share the address space of the parent task (process) Flags control behavior struct task_structpoints to process data structures (shared or unique)
73 QUESTIONS
74 BONUS Exam question number 2: Process Concept and Multithreaded Programming 10. 2
Multi-core Programming System Overview
Multi-core Programming System Overview Based on slides from Intel Software College and Multi-Core Programming increasing performance through software multi-threading by Shameem Akhter and Jason Roberts,
More informationOperating Systems. 05. Threads. Paul Krzyzanowski. Rutgers University. Spring 2015
Operating Systems 05. Threads Paul Krzyzanowski Rutgers University Spring 2015 February 9, 2015 2014-2015 Paul Krzyzanowski 1 Thread of execution Single sequence of instructions Pointed to by the program
More informationKernel comparison of OpenSolaris, Windows Vista and. Linux 2.6
Kernel comparison of OpenSolaris, Windows Vista and Linux 2.6 The idea of writing this paper is evoked by Max Bruning's view on Solaris, BSD and Linux. The comparison of advantages and disadvantages among
More informationChapter 6, The Operating System Machine Level
Chapter 6, The Operating System Machine Level 6.1 Virtual Memory 6.2 Virtual I/O Instructions 6.3 Virtual Instructions For Parallel Processing 6.4 Example Operating Systems 6.5 Summary Virtual Memory General
More informationProcesses and Non-Preemptive Scheduling. Otto J. Anshus
Processes and Non-Preemptive Scheduling Otto J. Anshus 1 Concurrency and Process Challenge: Physical reality is Concurrent Smart to do concurrent software instead of sequential? At least we want to have
More informationKernel Types System Calls. Operating Systems. Autumn 2013 CS4023
Operating Systems Autumn 2013 Outline 1 2 Types of 2.4, SGG The OS Kernel The kernel is the central component of an OS It has complete control over everything that occurs in the system Kernel overview
More informationObjectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.
Objectives To describe the services an operating system provides to users, processes, and other systems To discuss the various ways of structuring an operating system Chapter 2: Operating-System Structures
More informationOperating Systems for Parallel Processing Assistent Lecturer Alecu Felician Economic Informatics Department Academy of Economic Studies Bucharest
Operating Systems for Parallel Processing Assistent Lecturer Alecu Felician Economic Informatics Department Academy of Economic Studies Bucharest 1. Introduction Few years ago, parallel computers could
More informationOPERATING SYSTEM SERVICES
OPERATING SYSTEM SERVICES USER INTERFACE Command line interface(cli):uses text commands and a method for entering them Batch interface(bi):commands and directives to control those commands are entered
More informationLast Class: OS and Computer Architecture. Last Class: OS and Computer Architecture
Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 3, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts
More informationCS420: Operating Systems OS Services & System Calls
NK YORK COLLEGE OF PENNSYLVANIA HG OK 2 YORK COLLEGE OF PENNSYLVAN OS Services & System Calls James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts,
More informationHow To Write A Windows Operating System (Windows) (For Linux) (Windows 2) (Programming) (Operating System) (Permanent) (Powerbook) (Unix) (Amd64) (Win2) (X
(Advanced Topics in) Operating Systems Winter Term 2009 / 2010 Jun.-Prof. Dr.-Ing. André Brinkmann brinkman@upb.de Universität Paderborn PC 1 Overview Overview of chapter 3: Case Studies 3.1 Windows Architecture.....3
More informationCS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study
CS 377: Operating Systems Lecture 25 - Linux Case Study Guest Lecturer: Tim Wood Outline Linux History Design Principles System Overview Process Scheduling Memory Management File Systems A review of what
More informationBLM 413E - Parallel Programming Lecture 3
BLM 413E - Parallel Programming Lecture 3 FSMVU Bilgisayar Mühendisliği Öğr. Gör. Musa AYDIN 14.10.2015 2015-2016 M.A. 1 Parallel Programming Models Parallel Programming Models Overview There are several
More informationLast Class: OS and Computer Architecture. Last Class: OS and Computer Architecture
Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 3, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts
More informationFirst-class User Level Threads
First-class User Level Threads based on paper: First-Class User Level Threads by Marsh, Scott, LeBlanc, and Markatos research paper, not merely an implementation report User-level Threads Threads managed
More informationOperating System Tutorial
Operating System Tutorial OPERATING SYSTEM TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Operating System Tutorial An operating system (OS) is a collection
More informationELEC 377. Operating Systems. Week 1 Class 3
Operating Systems Week 1 Class 3 Last Class! Computer System Structure, Controllers! Interrupts & Traps! I/O structure and device queues.! Storage Structure & Caching! Hardware Protection! Dual Mode Operation
More informationOperating Systems and Networks
recap Operating Systems and Networks How OS manages multiple tasks Virtual memory Brief Linux demo Lecture 04: Introduction to OS-part 3 Behzad Bordbar 47 48 Contents Dual mode API to wrap system calls
More informationReal Time Programming: Concepts
Real Time Programming: Concepts Radek Pelánek Plan at first we will study basic concepts related to real time programming then we will have a look at specific programming languages and study how they realize
More informationOperating System: Scheduling
Process Management Operating System: Scheduling OS maintains a data structure for each process called Process Control Block (PCB) Information associated with each PCB: Process state: e.g. ready, or waiting
More informationChapter 2: OS Overview
Chapter 2: OS Overview CmSc 335 Operating Systems 1. Operating system objectives and functions Operating systems control and support the usage of computer systems. a. usage users of a computer system:
More informationOperating System Structures
COP 4610: Introduction to Operating Systems (Spring 2015) Operating System Structures Zhi Wang Florida State University Content Operating system services User interface System calls System programs Operating
More informationNetworking Operating Systems (CO32010)
Networking Operating Systems (CO32010) 2. Processes and scheduling 1. Operating Systems 1.1 NOS definition and units 1.2 Computer 7. Encryption Systems 1.3 Multitasking and Threading 1.4 Exercises 6. Routers
More informationHow To Understand The History Of An Operating System
7 Operating Systems 7.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: 7.2 Understand the role of the operating system.
More informationPOSIX. RTOSes Part I. POSIX Versions. POSIX Versions (2)
RTOSes Part I Christopher Kenna September 24, 2010 POSIX Portable Operating System for UnIX Application portability at source-code level POSIX Family formally known as IEEE 1003 Originally 17 separate
More informationChapter 1: Operating System Models 1 2 Operating System Models 2.1 Introduction Over the past several years, a number of trends affecting operating system design are witnessed and foremost among them is
More informationThreads Scheduling on Linux Operating Systems
Threads Scheduling on Linux Operating Systems Igli Tafa 1, Stavri Thomollari 2, Julian Fejzaj 3 Polytechnic University of Tirana, Faculty of Information Technology 1,2 University of Tirana, Faculty of
More informationComponents of a Computing System. What is an Operating System? Resources. Abstract Resources. Goals of an OS. System Software
What is an Operating System? An operating system (OS) is a collection of software that acts as an intermediary between users and the computer hardware One can view an OS as a manager of system resources
More informationPerformance Comparison of RTOS
Performance Comparison of RTOS Shahmil Merchant, Kalpen Dedhia Dept Of Computer Science. Columbia University Abstract: Embedded systems are becoming an integral part of commercial products today. Mobile
More information1 Organization of Operating Systems
COMP 730 (242) Class Notes Section 10: Organization of Operating Systems 1 Organization of Operating Systems We have studied in detail the organization of Xinu. Naturally, this organization is far from
More informationMiddleware and Distributed Systems. Design of Scalable Servers. Martin v. Löwis. Donnerstag, 16. Februar 12
Middleware and Distributed Systems Design of Scalable Servers Martin v. Löwis Problem Statement Allow multiple clients to connect to a server simultaneously, and handle connections from them in an overlapping
More informationSystem Structures. Services Interface Structure
System Structures Services Interface Structure Operating system services (1) Operating system services (2) Functions that are helpful to the user User interface Command line interpreter Batch interface
More informationCourse Development of Programming for General-Purpose Multicore Processors
Course Development of Programming for General-Purpose Multicore Processors Wei Zhang Department of Electrical and Computer Engineering Virginia Commonwealth University Richmond, VA 23284 wzhang4@vcu.edu
More informationChapter 2 System Structures
Chapter 2 System Structures Operating-System Structures Goals: Provide a way to understand an operating systems Services Interface System Components The type of system desired is the basis for choices
More informationCS3600 SYSTEMS AND NETWORKS
CS3600 SYSTEMS AND NETWORKS NORTHEASTERN UNIVERSITY Lecture 2: Operating System Structures Prof. Alan Mislove (amislove@ccs.neu.edu) Operating System Services Operating systems provide an environment for
More informationOperating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:
Chapter 7 OBJECTIVES Operating Systems Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the concept of virtual memory. Understand the
More informationExample of Standard API
16 Example of Standard API System Call Implementation Typically, a number associated with each system call System call interface maintains a table indexed according to these numbers The system call interface
More informationBuilding Applications Using Micro Focus COBOL
Building Applications Using Micro Focus COBOL Abstract If you look through the Micro Focus COBOL documentation, you will see many different executable file types referenced: int, gnt, exe, dll and others.
More informationReal-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur
Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No. # 26 Real - Time POSIX. (Contd.) Ok Good morning, so let us get
More information10.04.2008. Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details
Thomas Fahrig Senior Developer Hypervisor Team Hypervisor Architecture Terminology Goals Basics Details Scheduling Interval External Interrupt Handling Reserves, Weights and Caps Context Switch Waiting
More informationWeb Server Architectures
Web Server Architectures CS 4244: Internet Programming Dr. Eli Tilevich Based on Flash: An Efficient and Portable Web Server, Vivek S. Pai, Peter Druschel, and Willy Zwaenepoel, 1999 Annual Usenix Technical
More informationWhy Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes) John Ousterhout Sun Microsystems Laboratories john.ousterhout@eng.sun.com http://www.sunlabs.com/~ouster Introduction Threads: Grew up in OS world (processes).
More informationRoad Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.
Road Map Scheduling Dickinson College Computer Science 354 Spring 2010 Past: What an OS is, why we have them, what they do. Base hardware and support for operating systems Process Management Threads Present:
More informationChapter 2: Processes, Threads, and Agents
Process Management A distributed system is a collection of cooperating processes. Applications, services Middleware Chapter 2: Processes, Threads, and Agents OS: kernel, libraries & servers OS1 Processes,
More informationODROID Multithreading in Android
Multithreading in Android 1 Index Android Overview Android Stack Android Development Tools Main Building Blocks(Activity Life Cycle) Threading in Android Multithreading via AsyncTask Class Multithreading
More informationMultiprocessor Scheduling and Scheduling in Linux Kernel 2.6
Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6 Winter Term 2008 / 2009 Jun.-Prof. Dr. André Brinkmann Andre.Brinkmann@uni-paderborn.de Universität Paderborn PC² Agenda Multiprocessor and
More informationA Comparative Study on Vega-HTTP & Popular Open-source Web-servers
A Comparative Study on Vega-HTTP & Popular Open-source Web-servers Happiest People. Happiest Customers Contents Abstract... 3 Introduction... 3 Performance Comparison... 4 Architecture... 5 Diagram...
More informationThe Xen of Virtualization
The Xen of Virtualization Assignment for CLC-MIRI Amin Khan Universitat Politècnica de Catalunya March 4, 2013 Amin Khan (UPC) Xen Hypervisor March 4, 2013 1 / 19 Outline 1 Introduction 2 Architecture
More informationFachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert
Ubiquitous Computing Ubiquitous Computing The Sensor Network System Sun SPOT: The Sun Small Programmable Object Technology Technology-Based Wireless Sensor Networks a Java Platform for Developing Applications
More informationOperating System Overview. Otto J. Anshus
Operating System Overview Otto J. Anshus A Typical Computer CPU... CPU Memory Chipset I/O bus ROM Keyboard Network A Typical Computer System CPU. CPU Memory Application(s) Operating System ROM OS Apps
More informationPART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions. Outline. Performance oriented design
PART IV Performance oriented design, Performance testing, Performance tuning & Performance solutions Slide 1 Outline Principles for performance oriented design Performance testing Performance tuning General
More informationOperating System Impact on SMT Architecture
Operating System Impact on SMT Architecture The work published in An Analysis of Operating System Behavior on a Simultaneous Multithreaded Architecture, Josh Redstone et al., in Proceedings of the 9th
More informationOperating System Components
Lecture Overview Operating system software introduction OS components OS services OS structure Operating Systems - April 24, 2001 Operating System Components Process management Memory management Secondary
More informationIBM Software Group. Lotus Domino 6.5 Server Enablement
IBM Software Group Lotus Domino 6.5 Server Enablement Agenda Delivery Strategy Themes Domino 6.5 Server Domino 6.0 SmartUpgrade Questions IBM Lotus Notes/Domino Delivery Strategy 6.0.x MRs every 4 months
More informationCloud Computing. Up until now
Cloud Computing Lecture 11 Virtualization 2011-2012 Up until now Introduction. Definition of Cloud Computing Grid Computing Content Distribution Networks Map Reduce Cycle-Sharing 1 Process Virtual Machines
More informationSYSTEM ecos Embedded Configurable Operating System
BELONGS TO THE CYGNUS SOLUTIONS founded about 1989 initiative connected with an idea of free software ( commercial support for the free software ). Recently merged with RedHat. CYGNUS was also the original
More informationThe Double-layer Master-Slave Model : A Hybrid Approach to Parallel Programming for Multicore Clusters
The Double-layer Master-Slave Model : A Hybrid Approach to Parallel Programming for Multicore Clusters User s Manual for the HPCVL DMSM Library Gang Liu and Hartmut L. Schmider High Performance Computing
More informationDebugging with TotalView
Tim Cramer 17.03.2015 IT Center der RWTH Aachen University Why to use a Debugger? If your program goes haywire, you may... ( wand (... buy a magic... read the source code again and again and...... enrich
More informationCSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2007 Lecture 5 - DBMS Architecture
CSE 544 Principles of Database Management Systems Magdalena Balazinska Fall 2007 Lecture 5 - DBMS Architecture References Anatomy of a database system. J. Hellerstein and M. Stonebraker. In Red Book (4th
More informationCOS 318: Operating Systems
COS 318: Operating Systems OS Structures and System Calls Andy Bavier Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall10/cos318/ Outline Protection mechanisms
More informationEffective Computing with SMP Linux
Effective Computing with SMP Linux Multi-processor systems were once a feature of high-end servers and mainframes, but today, even desktops for personal use have multiple processors. Linux is a popular
More informationShared Address Space Computing: Programming
Shared Address Space Computing: Programming Alistair Rendell See Chapter 6 or Lin and Synder, Chapter 7 of Grama, Gupta, Karypis and Kumar, and Chapter 8 of Wilkinson and Allen Fork/Join Programming Model
More informationThis tutorial will take you through step by step approach while learning Operating System concepts.
About the Tutorial An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating system is a vital component
More informationIntroduction to Virtual Machines
Introduction to Virtual Machines Introduction Abstraction and interfaces Virtualization Computer system architecture Process virtual machines System virtual machines 1 Abstraction Mechanism to manage complexity
More informationDB2 Connect for NT and the Microsoft Windows NT Load Balancing Service
DB2 Connect for NT and the Microsoft Windows NT Load Balancing Service Achieving Scalability and High Availability Abstract DB2 Connect Enterprise Edition for Windows NT provides fast and robust connectivity
More informationMiddleware. Peter Marwedel TU Dortmund, Informatik 12 Germany. technische universität dortmund. fakultät für informatik informatik 12
Universität Dortmund 12 Middleware Peter Marwedel TU Dortmund, Informatik 12 Germany Graphics: Alexandra Nolte, Gesine Marwedel, 2003 2010 年 11 月 26 日 These slides use Microsoft clip arts. Microsoft copyright
More informationIntroduction to Cloud Computing
Introduction to Cloud Computing Parallel Processing I 15 319, spring 2010 7 th Lecture, Feb 2 nd Majd F. Sakr Lecture Motivation Concurrency and why? Different flavors of parallel computing Get the basic
More informationSoftware design (Cont.)
Package diagrams Architectural styles Software design (Cont.) Design modelling technique: Package Diagrams Package: A module containing any number of classes Packages can be nested arbitrarily E.g.: Java
More informationCSE 120 Principles of Operating Systems. Modules, Interfaces, Structure
CSE 120 Principles of Operating Systems Fall 2000 Lecture 3: Operating System Modules, Interfaces, and Structure Geoffrey M. Voelker Modules, Interfaces, Structure We roughly defined an OS as the layer
More informationProgramming real-time systems with C/C++ and POSIX
Programming real-time systems with C/C++ and POSIX Michael González Harbour 1. Introduction The C language [1], developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories, is the most widely
More informationChapter 3 Operating-System Structures
Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual
More informationAutomatic Logging of Operating System Effects to Guide Application-Level Architecture Simulation
Automatic Logging of Operating System Effects to Guide Application-Level Architecture Simulation Satish Narayanasamy, Cristiano Pereira, Harish Patil, Robert Cohn, and Brad Calder Computer Science and
More informationLecture 1 Operating System Overview
Lecture 1 Operating System Overview What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. The Major Objectives of an Operating system
More informationMulti-Threading Performance on Commodity Multi-Core Processors
Multi-Threading Performance on Commodity Multi-Core Processors Jie Chen and William Watson III Scientific Computing Group Jefferson Lab 12000 Jefferson Ave. Newport News, VA 23606 Organization Introduction
More informationACTOR-BASED MODEL FOR CONCURRENT PROGRAMMING. Sander Sõnajalg
ACTOR-BASED MODEL FOR CONCURRENT PROGRAMMING Sander Sõnajalg Contents Introduction to concurrent programming Shared-memory model vs. actor model Main principles of the actor model Actors for light-weight
More informationINTRODUCTION TO COMPUTING CPIT 201 WEEK 13 LECTURE 3
INTRODUCTION TO COMPUTING CPIT 201 WEEK 13 LECTURE 3 OPERATING SYSTEM Process manager A second function of an operating system is process management, but before discussing this concept, we need to define
More informationOperatin g Systems: Internals and Design Principle s. Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings
Operatin g Systems: Internals and Design Principle s Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings Operating Systems: Internals and Design Principles Bear in mind,
More informationCPS221 Lecture: Operating System Structure; Virtual Machines
Objectives CPS221 Lecture: Operating System Structure; Virtual Machines 1. To discuss various ways of structuring the operating system proper 2. To discuss virtual machines Materials: 1. Projectable of
More informationReplication on Virtual Machines
Replication on Virtual Machines Siggi Cherem CS 717 November 23rd, 2004 Outline 1 Introduction The Java Virtual Machine 2 Napper, Alvisi, Vin - DSN 2003 Introduction JVM as state machine Addressing non-determinism
More information4.1 Introduction 4.2 Explain the purpose of an operating system 4.2.1 Describe characteristics of modern operating systems Control Hardware Access
4.1 Introduction The operating system (OS) controls almost all functions on a computer. In this lecture, you will learn about the components, functions, and terminology related to the Windows 2000, Windows
More informationIntroducing PgOpenCL A New PostgreSQL Procedural Language Unlocking the Power of the GPU! By Tim Child
Introducing A New PostgreSQL Procedural Language Unlocking the Power of the GPU! By Tim Child Bio Tim Child 35 years experience of software development Formerly VP Oracle Corporation VP BEA Systems Inc.
More informationParallel Algorithm Engineering
Parallel Algorithm Engineering Kenneth S. Bøgh PhD Fellow Based on slides by Darius Sidlauskas Outline Background Current multicore architectures UMA vs NUMA The openmp framework Examples Software crisis
More informationTools Page 1 of 13 ON PROGRAM TRANSLATION. A priori, we have two translation mechanisms available:
Tools Page 1 of 13 ON PROGRAM TRANSLATION A priori, we have two translation mechanisms available: Interpretation Compilation On interpretation: Statements are translated one at a time and executed immediately.
More informationCPU Scheduling Outline
CPU Scheduling Outline What is scheduling in the OS? What are common scheduling criteria? How to evaluate scheduling algorithms? What are common scheduling algorithms? How is thread scheduling different
More informationIntro to GPU computing. Spring 2015 Mark Silberstein, 048661, Technion 1
Intro to GPU computing Spring 2015 Mark Silberstein, 048661, Technion 1 Serial vs. parallel program One instruction at a time Multiple instructions in parallel Spring 2015 Mark Silberstein, 048661, Technion
More informationCSCI E 98: Managed Environments for the Execution of Programs
CSCI E 98: Managed Environments for the Execution of Programs Draft Syllabus Instructor Phil McGachey, PhD Class Time: Mondays beginning Sept. 8, 5:30-7:30 pm Location: 1 Story Street, Room 304. Office
More informationLecture 6: Interrupts. CSC 469H1F Fall 2006 Angela Demke Brown
Lecture 6: Interrupts CSC 469H1F Fall 2006 Angela Demke Brown Topics What is an interrupt? How do operating systems handle interrupts? FreeBSD example Linux in tutorial Interrupts Defn: an event external
More informationLinux Process Scheduling Policy
Lecture Overview Introduction to Linux process scheduling Policy versus algorithm Linux overall process scheduling objectives Timesharing Dynamic priority Favor I/O-bound process Linux scheduling algorithm
More informationMulti-core architectures. Jernej Barbic 15-213, Spring 2007 May 3, 2007
Multi-core architectures Jernej Barbic 15-213, Spring 2007 May 3, 2007 1 Single-core computer 2 Single-core CPU chip the single core 3 Multi-core architectures This lecture is about a new trend in computer
More informationSymmetric Multiprocessing
Multicore Computing A multi-core processor is a processing system composed of two or more independent cores. One can describe it as an integrated circuit to which two or more individual processors (called
More informationPart I Courses Syllabus
Part I Courses Syllabus This document provides detailed information about the basic courses of the MHPC first part activities. The list of courses is the following 1.1 Scientific Programming Environment
More informationCEJVM: Cluster Enabled Java Virtual Machine
CE: Cluster Enabled Java Virtual Machine M.U. Janjua, M. Yasin, F. Sher, K. Awan, I. Hassan Faculty of Computer Science & Engineering, GIK Institute, Topi, Pakistan umar_janjua@yahoo.com, mmyasin@giki.edu.pk
More informationSoftware and the Concurrency Revolution
Software and the Concurrency Revolution A: The world s fastest supercomputer, with up to 4 processors, 128MB RAM, 942 MFLOPS (peak). 2 Q: What is a 1984 Cray X-MP? (Or a fractional 2005 vintage Xbox )
More informationCHAPTER 1 INTRODUCTION
1 CHAPTER 1 INTRODUCTION 1.1 MOTIVATION OF RESEARCH Multicore processors have two or more execution cores (processors) implemented on a single chip having their own set of execution and architectural recourses.
More informationCPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS
CPU SCHEDULING CPU SCHEDULING (CONT D) Aims to assign processes to be executed by the CPU in a way that meets system objectives such as response time, throughput, and processor efficiency Broken down into
More informationCS222: Systems Programming
CS222: Systems Programming The Basics January 24, 2008 A Designated Center of Academic Excellence in Information Assurance Education by the National Security Agency Agenda Operating System Essentials Windows
More informationGildart Haase School of Computer Sciences and Engineering
Gildart Haase School of Computer Sciences and Engineering Metropolitan Campus I. Course: CSCI 6638 Operating Systems Semester: Fall 2014 Contact Hours: 3 Credits: 3 Class Hours: W 10:00AM 12:30 PM DH1153
More informationSection 1.4. Java s Magic: Bytecode, Java Virtual Machine, JIT,
J A V A T U T O R I A L S : Section 1.4. Java s Magic: Bytecode, Java Virtual Machine, JIT, JRE and JDK This section clearly explains the Java s revolutionary features in the programming world. Java basic
More informationGoing Linux on Massive Multicore
Embedded Linux Conference Europe 2013 Going Linux on Massive Multicore Marta Rybczyńska 24th October, 2013 Agenda Architecture Linux Port Core Peripherals Debugging Summary and Future Plans 2 Agenda Architecture
More information