0% found this document useful (0 votes)
10 views18 pages

Lecture 8

Uploaded by

smilingpersonme
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views18 pages

Lecture 8

Uploaded by

smilingpersonme
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

1

Lahore Garrison University


CSC351-Operating System
Week-4 Lecture-8
Semester 5 Fall 2018
Prepared by:

Sabreena Nawaz
2
Instructor Contact Details

 Name: Sabreena Nawaz


 Course Instructor: CSC351- Operating System
 Credit Hours: 5
 Office Location: CS-Female Staff Room
 Email: [email protected]
 Visiting Hours: Wednesday (9-11 am)
 Lab Work: Video Tutorials & Supervision by Instructor

Lahore Garrison University


3
Course Objectives

 To learn the fundamentals of Operating Systems.


 To learn the mechanisms of OS to handle processes and
threads and their communication
 To learn the mechanisms involved in memory
management in contemporary OS.
 To gain knowledge on distributed operating
system concepts that includes architecture,
Mutual exclusion algorithms, deadlock detection
algorithms and agreement protocolsUnderstand
how to read C++ doc library documentation and
reuse library code.
 To learn programmatically to implement simple
OS mechanisms.

Lahore Garrison University


4
Course Contents

 Following contents will be covered throughout the


semester in week wise lectures:
 OS basics, OS types, system calls, process management,
inter process communication, communication in client
server systems, Thread concepts, thread types, thread
control block, thread designs, CPU scheduling, process
synchronization, bakery algorithm, hardware solutions to
synchronization, Problems of synchronization, deadlock
occurrence, prevention, avoidance recovery, Memory
management, virtual memory, page faults, replacement
algorithms, operating system security.

Lahore Garrison University


5
Text Book

 Operating system concepts by


Abraham Silberschatz, Galvin,
Gagne, 9th edition

Lahore Garrison University


6

►Sockets
►Remote procedure
Preamble call
(Past lesson ►pipes

brief)

Lahore Garrison University


7
Chapter 4: Threads

 Overview
 Multicore Programming
 Multithreading Models
 Thread Libraries
 Implicit Threading
 Threading Issues
 Operating System Examples

Lahore Garrison University


8
Objectives

 To introduce the notion of a thread—a fundamental unit


of CPU utilization that forms the basis of multithreaded
computer systems
 To discuss the APIs for the Pthreads, Windows, and Java
thread libraries
 To explore several strategies that provide implicit
threading
 To examine issues related to multithreaded
programming
 To cover operating system support for threads in
Windows and Linux
Lahore Garrison University
9
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
 Process creation is heavy-weight while thread creation is
light-weight
 Can simplify code, increase efficiency
 Kernels are generally multithreaded
Lahore Garrison University
1
Benefits 0

 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

Lahore Garrison University


1
Multicore Programming 1

 Multicore or multiprocessor systems putting pressure on


programmers, challenges include:
 Dividing activities
 Balance
 Data splitting
 Data dependency
 Testing and debugging
 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
Lahore Garrison University
1
Multicore Programming (Cont.)2

 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

Lahore Garrison University


1
Concurrency vs. Parallelism 3

 Concurrent execution on single-core system:

 Parallelism on a multi-core system:

Lahore Garrison University


1
Single and Multithreaded 4
Processes

Lahore Garrison University


1
User Threads and Kernel Threads
5

 User threads - management done by user-level threads library


 Three primary thread libraries:
 POSIX Pthreads
 Windows threads
 Java threads
 Kernel threads - Supported by the Kernel
 Examples – virtually all general purpose operating systems, including:
 Windows
 Solaris
 Linux
 Tru64 UNIX
 Mac OS X

Lahore Garrison University


1
6

Q&A

Lahore Garrison University


1
7
Reference

 To cover this topics , different reference material has


been used for consultation.
 Operating systems concept by Abraham siberchatz
edition 9
 Tutorialspoint.com
 Google.com

Lahore Garrison University


1
8

Thank you 

Lahore Garrison University

You might also like