FIT2100 Lecture Notes - Lecture 7: Readwrite, Linearizability, Inter-Process Communication

69 views2 pages
Lecture 7
Summary
-Two common approaches to support mutual exclusion for interprocess communication:
-Semaphores — for signal among processes and can be readily used to enforce mutual
exclusion
-Messages — an effective means of interprocess communication and useful for the
enforcement of mutual exclusion
Describe how messaging passing can enable interprocess communication
Message Passing:
-When processes interact with one another, two fundamental requirements must be satisfied
-Communication: to exchange information
-Synchronisation: to enforce mutual exclusion
-An approach to providing both of these functions
-Works with distributed systems, shared-memory multiprocessor and uniprocessor systems
-The actual function is normally provided in the form of a pair of primitive operations:
-Send (destination, message)
-Receive (source, message)
-A process sends information in the form of a message to another process designated by a
destination
-A process receives information by executing the receive primitive, indicating the source and the
message
Understand the readers/writers problem
-A data area is shared among many processors
-Some processes only read the data area (readers)
-Some only write to the data area (writers)
-Conditions that must be satisfied:
1. Any number of readers may simultaneously read the file
2. Only one writer at a time may write to the file
3. If a writer is writing to the file, no reader may read it
Discuss the mechanisms for interprocess communication and synchronisation in Unix/Linux
systems
Unix: Concurrency Control Mechanisms:
-Pipes
-Circular buffers allowing two processes to communicate on the producer-consumer model
-FIFO queue — written by one process and read by another
-Mutual exclusion is enforced: only one process can access a pipe at a time
-Two types of pipes:
-Named — can be shared by related or unrelated processes
-Unnamed — can only be shared by related processes
-Messages
-A block of bytes with an accompanying type
-UNIX provides msgsnd and msgrcv system calls for processes to engage in message passing
-Associated with each process is a message queue, which functions like a mailbox
-Shared Memory
-Fastest form of interprocess communication
-Common block of (virtual) memory shared by multiple processes
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Two common approaches to support mutual exclusion for interprocess communication: Semaphores for signal among processes and can be readily used to enforce mutual exclusion. Messages an effective means of interprocess communication and useful for the enforcement of mutual exclusion. Describe how messaging passing can enable interprocess communication. When processes interact with one another, two fundamental requirements must be satisfied. An approach to providing both of these functions. Works with distributed systems, shared-memory multiprocessor and uniprocessor systems. The actual function is normally provided in the form of a pair of primitive operations: A process sends information in the form of a message to another process designated by a destination. A process receives information by executing the receive primitive, indicating the source and the message. A data area is shared among many processors. Some processes only read the data area (readers) Some only write to the data area (writers)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents