PRINCIPLES OF I/O HARDWARE 5.2 PRINCIPLES OF I/O SOFTWARE 5.3 I/O SOFTWARE LAYERS 5.4 DISKS 5.5 CLOCKS 5.6 CHARACTER-ORIENTED TERMINALS 5.7 GRAPHICAL USER INTERFACES 5.8 NETWORK TERMINALS 5.9 POWER MANAGEMENT 5.10 RESEARCH ON INPUT/OUTPUT 5.11 SUMMARY
Trang 2C C C C
M C C
C Shared
memory
connect
Inter-CPU
Local memory
M C C M
Trang 3message-CPU CPU M
Shared memory
Shared memory
Fig 8-2 Three bus-based multiprocessors (a) Without caching.(b) With caching (c) With caching and private memories
Trang 4Closed crosspoint switch
Open crosspoint switch (a)
(b)
(c)
Crosspoint switch is closed
Crosspoint switch is open 000
Trang 5B
X Y
Module Address Opcode Value
Fig 8-4 (a) A 2 × 2 switch (b) A message format
Trang 70 0 1 0 0
Trang 8CPU 2
Has private OS
CPU 3
Has private OS
1 2 Data Data
3 4 Data Data
OS code
Bus
Fig 8-7 Partitioning multiprocessor memory among four CPUs,but sharing a single copy of the operating system code The boxesmarked Data are the operating system’s private data for each CPU
Trang 9CPU 2
Slave runs user processes
CPU 3
User processes OS
Bus
Slave runs user processes
Fig 8-8 A master-slave multiprocessor model
Trang 10CPU 2
Runs users and shared OS
CPU 3
Runs users and
Locks Bus
Fig 8-9 The SMP multiprocessor model
Trang 11CPU 1 Memory CPU 2
Bus
Word
1000 is initially 0
Trang 12CPU 3
CPU 3 spins on this (private) lock
CPU 4 spins on this (private) lock CPU 2 spins on this (private) lock
When CPU 1 is finished with the real lock, it releases it and also releases the private lock CPU 2
is spinning on
CPU 1 holds the real lock Shared memory
4 2
3
1
Fig 8-11 Use of multiple locks to avoid cache thrashing
Trang 131 5 9 13
2 6 10 14
3 7 11 15
B C
D E F
G H I
J K
L M N
7 5 4 2 1 0
Priority
CPU 4 goes idle
CPU 12 goes idle
0 A 8 B
1 5 9 13
2 6 10 14
3 7 11 15
C
D E F
G H I
J K
L M N
7 5 4 2
1 0 Priority
Fig 8-12 Using a single data structure for scheduling a cessor
Trang 146-CPU partition
8-CPU partition
Fig 8-13 A set of 32 CPUs split into four partitions, with twoCPUs available
Trang 15Fig 8-14 Communication between two threads belonging to
process A that are running out of phase.
Trang 18CPU 1 Input port
(a)
Output port
Entire packet
Entire
packet
Four-port switch
C
A
CPU 2
Entire packet D
(c)
C
A
D B
Fig 8-17 Store-and-forward packet switching
Trang 19CPU
CPU
CPU Switch
Node 2 Main RAM
Main RAM
Node 4
Interface board
Optional on- board CPU Interface
board RAM Node 3
Main RAM
Main RAM Node 1
3 2
Trang 20multicom-Node 1 Node 2
CPU
7 2 3 4 6
Receive ring CPUSend ring
7 0 1 2 4
OS OS
Fig 8-19 Use of send and receive rings to coordinate the mainCPU with the on-board CPU
Trang 21Sender blocked
Sender blocked
Trap to kernel, sender blocked
Message being sent
Message being sent Sender running
Sender running
Return Sender running
Sender running
Trap
Message copied to a kernel buffer
Return from kernel, sender released
(a)
(b)
Fig 8-20 (a) A blocking send call (b) A nonblocking send call
Trang 22Client CPU
Client stub Client
2 1
Operating system
Server CPU Server
Network
Fig 8-21 Steps in making a remote procedure call The stubs areshaded gray
Trang 23Operating system Application
Hardware
(b)
Run-time system
Operating system
Shared memory
Application
Hardware
Run-time system
Operating system Application
Hardware
(c)
Run-time system
Operating system
Shared memory
Application
Hardware
Run-time system
Operating system Application
Hardware
Fig 8-22 Various layers where shared memory can be mented (a) The hardware (b) The operating system (c) User-level software
Trang 24imple-Globally shared virtual memory consisting of 16 pages
Memory
Network (a)
Trang 25CPU 1
Code using
variable A
A B
Shared
page
CPU 2
Code using variable B
A B
Network
A and B are unrelated shared variables that just happen to be on the same page
Fig 8-24 False sharing of a page containing two unrelated ables
Trang 268 1 2
8 1 2
4
3 6 2
1
4
Node 3 Traffic
Trang 27I’m full Here, have a process
Take some work
Trang 29SPARC Solaris
Application
Mac OS Application
Macintosh Common base for applications
Network
Fig 8-28 Positioning of middleware in a distributed system
Trang 30Ethernet
Switch Computer
Ethernet
(b) (a)
Fig 8-29 (a) Classic Ethernet (b) Switched Ethernet
Trang 31Backbone High-bandwidth fiber
Trang 32Reliable message stream Reliable byte stream Unreliable connection Unreliable datagram Acknowledged datagram Request-reply
Example
Sequence of pages of a book Remote login
Digitized voice Network test packets Registered mail Database query
Connection-oriented
Connectionless
Fig 8-31 Six different types of network service
Trang 33Ethernet 1 header
Trang 34School of Humanities School of Sciences School of Social Sciences
Science Astronomy Biology Chemistry Physics Main page
Social sciences Anthropology Psychology Sociology Main page
Astronomy Dept.
Galaxies Nebulas Planets Quasars Stars Sciences
Biology Dept.
Arachnids Protozoa Worms Sciences
Chemistry Dept.
Acids Bases Proteins Sciences
Physics Dept.
Electrons Mesons Neutrons Neutrinos Protons Sciences
Anthropology Dept.
African tribes Australian tribes New Guinean tribes Social sciences
Psychology Dept.
Freud Rats Social sciences
Sociology Dept Class struggle Gender struggle Generic struggle Social sciences
Fig 8-33 The Web is a big directed graph of documents
Trang 352 Accesses are
done on the
client
3 When client is done, file is returned to server
Fig 8-34 (a) The upload/download model (b) The remote accessmodel
Trang 36Fig 8-35 (a) Two file servers The squares are directories and thecircles are files (b) A system in which all clients have the sameview of the file system (c) A system in which different clientsmay have different views of the file system.
Trang 37Fig 8-36 (a) Sequential consistency (b) In a distributed systemwith caching, reading a file may return an obsolete value.
Trang 38User process
Vice server
Operating system Operating system
Venus
Network
Symbolic link
Root directory bin
cmu cache etc lib tmp
cp ls sh
file 1 file 2 file 3
cell1 cell2 cell3 cell4
motd passwd
sh
Fig 8-37 (a) The position of venus and vice in AFS (b) A
client’s view of the file system
Trang 39Client Client stub
Operating system Client ORB
Client
code
Object adapter
Operating system
Server code
Server Skeleton
IIOP protocol
Network Server ORB
Fig 8-38 The main elements of a distributed system based onCORBA The CORBA parts are shown in gray
Trang 40List messages Read message Append message Delete message State of
Class object contains the method
Fig 8-39 The structure of a Globe object
Trang 41R W
R W
R W
R W
Trang 42Computer Object
Semantics subobject
Communication subobject
Interface Control
subobject
Replication
subobject
Security subobject
Operating system
Messages in and out go through the communication subobject Network
Fig 8-41 Structure of a Globe object
Trang 43("abc", 2, 5)
("matrix-1", 1, 6, 3.14)
("family", "is-sister", "Stephany", "Roberta")
Fig 8-42 Three Linda tuples
Trang 44Information router
Daemon Consumer