0% found this document useful (0 votes)
8 views

Lecture 7

Uploaded by

smilingpersonme
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lecture 7

Uploaded by

smilingpersonme
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

1

Lahore Garrison University


CSC351-Operating System
Week-4 Lecture-7
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

Process concept
►Inter
process
Preamble communication
(Past lesson ►Communication
models
brief)

Lahore Garrison University


7
Chapter 3: Processes

 Process Concept
 Process Scheduling
 Operations on Processes
 Interprocess Communication
 Examples of IPC Systems
 Communication in Client-Server Systems

Lahore Garrison University


8
Learning Outcomes

 To introduce the notion of a process -- a program in


execution, which forms the basis of all computation
 To describe the various features of processes,
including scheduling, creation and termination, and
communication

Lahore Garrison University


9
Communications in Client-Server Systems

 Sockets
 Remote Procedure Calls
 Pipes
 Remote Method Invocation (Java)

Lahore Garrison University


1
Sockets 0

 A socket is defined as an endpoint for communication

 Concatenation of IP address and port – a number included at


start of message packet to differentiate network services on a
host

 The socket 161.25.19.8:1625 refers to port 1625 on host


161.25.19.8

 Communication consists between a pair of sockets

 All ports below 1024 are well known, used for standard services

 Special IP address 127.0.0.1 (loopback) to refer to system on


which process is running
Lahore Garrison University
1
Socket Communication 1

Lahore Garrison University


1
Sockets in Java 2

 Three types of sockets


 Connection-oriented
(TCP)
 Connectionless (UDP)
 MulticastSocket
class– data can be sent
to multiple recipients

 Consider this “Date”


server:

Lahore Garrison University


1
Remote Procedure Calls 3

 Remote procedure call (RPC) abstracts procedure calls


between processes on networked systems
 Again uses ports for service differentiation
 Stubs – client-side proxy for the actual procedure on
the server
 The client-side stub locates the server and marshalls
the parameters
 The server-side stub receives this message, unpacks
the marshalled parameters, and performs the
procedure on the server
 On Windows, stub code compile from specification
written in Microsoft Interface Definition
Language
Lahore Garrison University (MIDL)
1
Remote Procedure Calls (Cont.)4

 Data representation handled via External Data


Representation (XDL) format to account for
different architectures
 Big-endian and little-endian
 Remote communication has more failure scenarios
than local
 Messages can be delivered exactly once rather than at
most once
 OS typically provides a rendezvous (or matchmaker)
service to connect client and server

Lahore Garrison University


1
Execution of RPC 5

Lahore Garrison University


1
Pipes 6

 Acts as a conduit allowing two processes to communicate


 Issues:
 Is communication unidirectional or bidirectional?
 In the case of two-way communication, is it half or full-duplex?
 Must there exist a relationship (i.e., parent-child) between
the communicating processes?
 Can the pipes be used over a network?
 Ordinary pipes – cannot be accessed from outside the
process that created it. Typically, a parent process creates
a pipe and uses it to communicate with a child process
that it created.
 Named pipes – can be accessed without a parent-child
relationship.
Lahore Garrison University
1
Ordinary Pipes 7

 Ordinary Pipes allow communication in standard producer-consumer style


 Producer writes to one end (the write-end of the pipe)
 Consumer reads from the other end (the read-end of the pipe)
 Ordinary pipes are therefore unidirectional
 Require parent-child relationship between communicating processes

 Windows calls these anonymous pipes


 See Unix and Windows code samples in textbook
Lahore Garrison University
1
Named Pipes 8

 Named Pipes are more powerful than ordinary pipes


 Communication is bidirectional
 No parent-child relationship is necessary between the
communicating processes
 Several processes can use the named pipe for
communication
 Provided on both UNIX and Windows systems

Lahore Garrison University


1
9
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


2
0

Q&A

Lahore Garrison University


2
1

Thank you 

Lahore Garrison University

You might also like