CS 321 Spring 2013  >  Lecture Notes for Monday, April 8, 2013

CS 321 Spring 2013
Lecture Notes for Monday, April 8, 2013

Other Resource-Contension Issues

Two-Phase Locking

This is a way of preventing deadlock by doing acquisition in two phases. First, a process requests all resources in a non-blocking manner. If they are all acquired, they are used and released. If any resource is not acquired, then all are released, and we start over.

Communication Deadlock

Lost messages (for example) can cause a kind of deadlock that is not related to resource allocation. Suppose process A is waiting for a message from process B; when it is received, A will reply. B sends the message to A, and then waits for the reply. Now, if the initial message is lost, then each process will wait for the other forever. We have deadlock, but there are no resources involved.


Like deadlock, but with busy-waiting instead of blocking. Processes are all running, but not accomplishing anything.


If resources are allocated preferentially to certain processes, and these processes continually make requests, then other processes may never get access.

Introduction to Networking


Networking means automatically transferring data from one computer to another. This may not seem complicated, but consider:

Some terminology: A packet is a collection of data that travels together (or appears to) across a network. Sometimes we use the term segment to mean essentially the same thing.

We will use the term reliability. This has two meanings. First, it is the probability that some functionality will perform as desired. Second, it is the property of giving assurances of success. So functionality is reliable if it gives such assurances.

For example, the fundamental protocol of the Internet is IP. IP is not reliable. When a packet is sent via IP, there is no assurance that it is received. A protocol built on top of IP is TCP. TCP is reliable, despite the fact that it sends information via the unreliable IP protocol. TCP achieves this by allowing for acknowledgements of received segments, and retrying if no acknowledgement is received.

Note that the fact that IP is unreliable is not necessarily a bad thing. The decision was made to include reliability at the TCP level. Thus, IP does not need to be reliable; making it reliable would add needless complexity.

The OSI Model

The OSI Model is a standard model of a network. It is divided into seven layers, with each layer dealing only with the layers immediately above and below it. Thus each layer presents an abstraction of the layers below it to the layers above it. This allows for layers to be altered without requiring a change in all network functionality.

For example, as long as we can do IP over some network, we can do TCP on top of the IP, no matter whether the network is actually wires, optical fiber, or a radio link.

The OSI Model is never completely implemented, but it provides a useful framework for understanding networking. Here are the seven layers, from low to high.

This is the wires, fiber, or whatever that carries the data.
Data Link
This involves connections between physical networks.
Machine-to-machine packets. IP is at this level.
User-to-user messages. TCP is roughly at this level.
Conversation as data in a recognizable form (not just bits).
The interface to the application.

Introduction to Networking will be continued next time.

CS 321 Spring 2013: Lecture Notes for Monday, April 8, 2013 / Updated: 6 May 2013 / Glenn G. Chappell / ggchappell@alaska.edu