Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
1988
Implementation of an activity coordinator for an
activity-based distributed system
Robert Shaw
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion
in Theses by an authorized administrator of RIT Scholar Works. For more information, please contact
.
Recommended Citation
Rochester Institute of Technology
School of ComputeI Science and Technology
Implementation of an Activity Coordinator
for an
Activity-Based Distributed System
Robert Shaw
A thesis, submitted to
The Faculty of the school of Computer Science and Technology,
in partial fdfillment of the requirement for the degree of
Master of Science in Computer Science
Approved by:
Dr. James E. Heliotis
Dr. Andrew
T. Kitchen
I,Robert Shaw,
do hereby grant permission to
Wallace
Memorial Library of R.I.T.,
to reproduce
my thesis
in whole
or in part.
Any reproduction
Implementation
of anActivity
Coordinator
for
anActivity-Based Distributed System
Abstract
Distributed computing
systems offer a number of potentialbenefits,
including:
-
improved
fault-tolerance
and
reliability
-
increased
processor
availability
-
faster
responsetime
-flexibility
of system configuration
-effective management of
geographically
distributed
resources-
integration
of special purposemachines
into
applicationsIn
orderto
realizethis
potential,
support systemsthat
aidin
the
development
ofdistributed
programs are needed.An
Activity
System facilitates
the
design
andimplementation
ofdistributed
programs:(1)
By
allowing
the
programmerto
group
functionally
related objectsinto
anactivity
(or
job)
whichis
recorded withinthe
system.The information
storedconcerning
relationshipsbetween
objectsmay
thenbe
usedto
controltheir
interactions
andthus to
managedistributed
resources.(2)
By
effectively eliminating
the
needfor
the
programmerto
deal
withthe
underlying
details
ofinter-process
communication.The
systemhandles
the
establishment ofcommunicationlinks between
objectsin
anactivity,
andcontrolsthe routing
of messagesto
activity
members.To
evaluatethe
uses of activitiesin
developing
distributed
programs,
I have implemented
a portion of such asystem; namely,
anActivity
Coordinator
,together
withActivity
System
components and test tools required to verify
its functionality.
Within
the context of anActivity System,
the
Activity
Coordinator
provides certainkey
func
tions:(1)
It
maintains adatabase
ofinformation
pertaining
to
objects andactivities,
and(2)
It handles
the
routing
ofactivity
related messages.Table
ofContents
Introduction
1
Chapter
1.
Distributed Systems
3
1.1
Objectives
3
1.2
Issues
4
1.3
Definitions
5
Chapter
2.
Traditional Methods
6
2.1
IPC Classification
6
2.2 RPC
-Courier
7
2.3
Rendezvous
-XMS
8
2.4 Port-Based
-Accent
9
Chapter 3.
Recent Systems
10
3.1
The Object
Model
12
3.2 Transactions
16
3.3
Objects
andActions
18
3.4
The Role
ofProcesses
21
3.5
Active
vsPassive
Objects
22
3.6
Cronus
23
3.7
Argus
25
3.8
Clouds
28
3.9 Archons
31
3.10 TABS
33
3.11
Real-time
Process
Control
36
ipter
4.
Activity
System
41
1.1
System Description
41
4.2
A Sample
Activity
46
4.3
Activities
vs. other systems47
apter
5.
Implementation
49
5.1
AC Functions
49
5.2
AC Design
52
apter
6.
A Simulation
57
6.1
System
description
57
6.2 Simulation
Design
andImplementation
...59
6.3
Object
Implementor
59
6.4
Name Server
63
6.5
Simulation
-Objects
andACM's
65
6.6
System
Startup
andOperation
69
6.7
Test
Tool Programs
72
apter
7.
Implementation
Issues
73
7.1 Database Issues
73
7.2 Communication Issues
79
7.3 Simulation Issues
82
apter
8.
Conclusions,
etc86
8.1
Conclusions
86
8.2
Issues
andRelated Topics
87
8.3
System
Performance
89
Introduction
Distributed
computing
systemsoffer a number of potentialbenefits,
including:
-
improved
fault-tolerance
andreliability
-
increased
processoravailability
-
faster
response
time
-flexibility
of system configuration
-effective management of
geographically distributed
resources
-integration
of special purpose machinesinto
applicationsIn
orderto
take
full
advantage ofthis
potential,
support systemsthat
aidin
the
development
ofdistributed
programsare needed.
The
Activity
Model
[Heliotis84]
provides a number of usefultools
for
this
purpose.To
evaluatethe
uses ofactivities
in
developing
distributed
programs,
implementation
of atleast
a prototypeactivity
systemis
required.To
this end,
I have implemented
a portion of such asystem; namely,
anActivity
Coordinator
,together
withActivity
System
components and testtools
for verifying
its functionality.
The
purposes of anactivity
system andthe
role ofthe activity
coordinator are outlinedbelow.
An
activity
systemfacilitates
the
design
andimplementation
ofdistributed
programs:(l)
By
allowing
the
programmerto
group
functionally
related objectsinto
anactivity
(or
job)
andto
recordthis
relationship
withinthe
system.This information
concerning
relationshipsbetween
objectsmay
then
be
used
to
controltheir
interactions.
An
activity
may be
further divided into
sub-activities,
thereby
permitting
alogical
hierarchy
to
be
built.
The
system also provides mechanisms
for
managing
the
dynamics
ofthe
activity
structurethus
created.(2)
By
effectively eliminating
the needfor
the
programmerto
deal
withthe
underlying details
ofinter-process
communication.
The
systemhandles
the
establishment of communicationlinks between
objectsin
anactivity,
and controls
the
routing
of messagesto activity
members.As
we shallsee,
the activity
modelallows programmersto
construct reliabledistributed
programs while retaining "flexibility
ofmanagement[Ellis85].
Within
the
context ofthis system, the
Activity
Coordinator
(AC)
provideskey
functions:
(l)
It
maintains adatabase
ofinformation pertaining to
objects andactivities,
and(2)
It handles
the routing
ofactivity
related messages.
In
future
versions ofthe
activity
systemthe
AC
may
alsoplay
amoreactive rolein fault
recovery.Chapter
1
outlinesthe
objectives ofdistributed
computation anddiscusses
the
issues
relatedto achieving
the
potential
benefits.
In Chapter
2,
I
willdiscuss
'traditional'communications-oriented approaches
to
distributed
computing.
Chapter
3
describes
more recent workin language/system
supportfor distributed
programming,
including
adiscussion
ofthe
object model and atomic actions.Chapter
4
describes
the activity
modelin
detail, focusing
oncharacteristicswhich
distinguish it from
otherrecently
proposed systems.Chapter
5
details
my
design
andimplemen
tation
planfor
the
Activity
Coordinator.
Chapter
6
outlinesthe test
procedurefor
the
coordinator anddescribes
asystem
built for
this
purpose.Chapter
7
addressesissues involved in
the
actualimplementation
ofthe
coordinator.Pertinent
topics
in inter-process
communication anddistributed database
management willbe discussed.
Finally,
Chapter 8
presents conclusions and suggestionsfor future
workin
the
development
of anactivity
system.Chapter One
1.1 Objectives
ofDistributed
Processing
The
objectives ofdistributed
computing
canbe described in
terms
ofthe
benefits
that
canbe
achievedin
the
following
areas:1.
Reliability
- refersto
the
periodduring
which system services are provided withoutinterruption,
andis
usually
expressedin
terms
ofMean Time Between Failures
(MTBF)
andMean Time To Repair
(MTTR).
The
fact
that
more processors arein
usein
adistributed
systemincreases
the
probability
that
atleast
one ofthem
will
be
functioning
atany
giventime.
The
systemmay
thus
be
ableto
survivethe
failure
ofindividual
components while
retaining
ahigh degree
offunctionality.
2.
Availability
-Closely
relatedto
reliability
is
availability.Availability
is
the
fraction
oftime that
systemcomponents are
operational,
and canbe
computed asMTBF/(MTBF+MTTR).
Availability
is
dependent
onthe
level
ofredundancy
andability
to
reconfigurethe
system.By having
the
ability
to
put replicated resourcesto
work,
the
overallavailability
ofthe
system canbe
greatly
increased.
3.
Performance
-Better
performance canbe
achievedin
anumber ofways:a)
Faster
responsetime
canbe
achievedby
exploiting
parallelisminherent
in
applications.b)
Overall
performance canbe improved
by balancing
the
load
on system resources.c) In
somecases,
integration
of special purpose machines can resultin
greater efficiency.Instead
ofusing
general purpose machines
for
executing
avariety
ofindependent
tasks,
eachprocessing
element canbe
specializedto
performthe
requiredtasks
asefficiently
as possible.4.
Resource
sharing
-A
distributed
system architecture permits effective use ofphysically
dispersed
and/orexpensive resources
by
multiple users.5.
Extensibility
-Distributing
hardware
andsoftware components allowsfor
greaterflexibility
of systemguration.
The
modular nature of adistributed
architecturepermitsprocessing
elementsto
be
removed or addedeasily.
1.2
Issues
in
Distributed
Processing
-Achieving
the
Objectives
The benefits
ofdistributed
computing
do
not accrueautomatically
from
simply connecting
together
hardware
components.
In
orderto
achievethe
objectives outlinedabove,
newissues
mustbe
addressed:1.
Reliability
-to
achieve
improved
reliability
in
spite ofprocessing
failures,
software mustbe
providedto
perform
errordetection, diagnosis,
andrecovery
(including
re-configuration,
if
necessary).2.
Availability
-the
use of more processorsincreases
the
probability
that
any
oneofthem
willfail
over a givenperiod of
time.
In
additionto
making
each componenthighly
reliable,
ahigh degree
ofredundancy
canimprove
the
overall system availability.Additional
softwareis
requiredto
managethe
use of replicatedresources.
3.
Performance
-to
achieveincreased
performance,
resources mustbe distributed
in
such away
that the
fol
lowing
criteriaare met:a)
Computation
is
performedin
such away
that
concurrentprocessing
canoccur,
andthus,
unnecessary
sequentialization should
be
avoided.For
generaldistributed
computing,
determining
possible parallel executions
is
anon-trivial problem.Furthermore,
system controlis
neededto
detect
and resolveconflicting
processing
requests withoutimpairing
parallelism.b)
The load
on resources(processors,
memory,
communications)
is balanced
(at
the
very
least
suchthat
noneis
overloaded,
andideally
suchthat
eachcomponent achieves optimal performance).c) The
overheadincurred
by
communicationdoes
not overridethe
benefits
obtainedthrough
distribution
overmany
(possibly
specialized)
machines.4.
Resource
sharing
-A
support systemfor
distributed
computing
should provide system-wide control of activitiesfor
the
purposeof
achieving
optimalresource utilization.Techniques
usedin
a centralprocessorfor
controlling
accessto
sharedresources
typically involve
serializing
the
executionofpotentially competing
parallel processes.In
adistributed
system,
asynchronization mechanismthat
preservesconcurrency
is
required.5.
Extensibility
-It
shouldbe
possible
to
reconfigureprocessing
elementsdynamically
withoutdisrupting
the
system.
Configuration
control mustbe
providedthat
minimizesthe
impact
of such changes onthe
system.1.3
Distributed Systems
-Definitions
The
hardware
componentsofadistributed
systemmay
be
viewed as aset of nodesconnected via a communications network,
where a node consists ofprocessor(s),
memory,
andany
numberofexternaldevices.
A distributed
program
is
a set of modulesthat
runon nodes and which cooperate(by
exchanging
messages) in
orderto
achievetheir
goals.
Physically
distributed hardware
and a collection ofdistributed
programsdo
not,
however,
constitute adistri
buted
system.In
additionthere
mustbe
sometype
of system supportfor
handling
interprocess
communication,
synchronization,
and recovery.Before
discussing
these
issues it is important
to
note certain characteristics of adistributed
system which affectthe
possible solutions:There is
nosharing
ofmemory
among
processmodules,
and all communicationis
accomplished via
links between
nodes.Interprocess
communicationdelays
are variable and non-zero.As
aresult,
sometime
always existsbetween
the
production ofan event andthe
realization ofthat
event atits destination. This is in
addition
to the
delay
that
existsfor
the
eventto
be
observedby
othermodules.Whereas in
sharedmemory
multiprocessors
the
exchange ofinformation
between
modules occursin
microseconds,
in
adistributed
systemit
may
take
many
milliseconds.Due
to the
distribution
of stateinformation
and messageinduced
time
delay,
it is
not possiblefor
a single moduleto
have
a complete current view ofthe
entire system state.As
aresult,
system controlis
performed
by
several modules which cooperateto
providesynchronization,
recovery
and runtime management.It is
this
distributed
computation management -in
particular,
withinthe
framework
ofthe
activity
model -that
is
the
focus
ofthis thesis.
Chapter Two
Traditional
Methods
The
traditional
approachto
designing
distributed
systemshas
emphasizedcommunications,
withthe
goal ofmaking networking
anddistribution
of resourcestransparent
to the
user.As
aresult,
these
systemshave
concentrated
onthe
structure and semantics ofinter-process
communication(IPC).
2.1
IPC Classification
One
way
ofclassifying
messagepassing
paradigmsis
by
their
communication structures:(l)
one-to-one- occursbetween
two
specific processes.Specifying
the
processesin
communications statements createsa staticcommunication channel
by
direct
naming.This
methodof communicationis
employedby
CSP
[Hoare78].
(2)
one-to-many
- a processmay
needto
broadcast
a messageto
multipledestinations. This is
frequently
the
casein
real-time systems where
the
outputfrom
one sensormay
be
requiredby
several controllers andmonitoring
devices.
Other
examplesinclude distributed
applicationsin
whichinformation
from
one nodeis
shared with other nodesin
the
system such asdistributed
routing
algorithms,
automatedload
balancing,
and name servers.(3)
many-to-one - several clientprocessesmay
communicate with one serverprocess,
asfor
example when severalusers share a single
device. The
client/server modelis
the
mostcommonly
used approachin
constructing
distributed
applications.
Such
systemsnormally
operate asfollows:
A
server processlistens
at awellknown
addressfor
servicerequests.
Client
processes request servicesby initiating
a connection withthe
server.In
adistributed
environmentthere
must alsobe
a mechanismwhereby
clients can access remote servers.This
typically
involves
the
use of nameservers
to
locate
the
target
for
requests.In
developing
client and serverapplications,
the
protocolfor
making
andaccepting
servicerequests,
aswell asfor
remote serviceaccess,
mustbe
establishedbeforehand
andimplemented
by
both
ends ofthe
connection.Of
course,
variations ofthis
protocol existdepending
onthe
semantics of communication
(see
below
-Courier,
XMS).
(4)
many-to-many
- arises whenthere
are several clients
requesting
servicesfrom
any
one of a number ofidentical
servers.
IPC
mechanismsmay
alsobe
classifiedbased
onthe
synchronization properties of message passing.In
asynchronous message
passing, the
execution of a send statementdoes
notdelay
the
sending
process.In
orderto
achievethis
non-blocking send,
however,
there
mustbe
buffering
ofmessagesbetween
sender andreceiver.If
buffering
is
notavailable, the
senderis delayed
untilthe
messageis
received.This is known
as synchronous message passing.In
Remote
Invocation
Send,
the sending
process waits notonly
for
the
messageto
be
received,
but
alsofor
areply
to
be
returned.
On
the
receiverside,
message receiptmay
eitherbe
explicitusing
ablocking
receivestatement,
orimplicit
(non-blocking)
by invoking
some code module similarto
aninterrupt handler.
The
following
sections serveto
illustrate how
these
communication mechanisms are usedin
certain representative
implementations.
2.2
Remote Procedure Call
-Courier
Remote invocation
sendtogether
withimplicit
receive constitutesRemote
Procedure
Call
(RPC).
This is
the
mechanism used
by
the
Courier
system[Xerox81].
In
thissystem,
a single passivelistening
process - theCourier
server - resides at a well
known
address on each machine.Client
processes(typically
applicationprograms)
comprisethe
active system elements.When
a client processinitiates
a connectionto
the
Courier
socket,
the
listener
spawns aserver
to
attendto the
user request.Courier handles
the underlying
communication callsbetween
machinessothat
aremote procedure call
behaves from
the
user perspective asif
the
procedure were performedlocally.
Unfortunately,
the
synchronous messagepassing
semantics ofRPC limits
parallelism.First,
sinceCourier
is
based
on virtual circuitsthe
caller must await a connection withthe
server.Second,
remote procedure calls must executesequentially,
notconcurrently,
sincethe
callermust await results.2.3
Rendezvous
-XMS
Combining
remoteinvocation
send and explicit receive statementsis known
asRendezvous
[Ada83].
The
eventsequence
for
rendezvousis
shownin figure
[2.1].
A
rendezvous occurs asfollows: Task A invokes
anentry
declared in
the
interface
specification oftask
B.
Task B
executes an accept statementenabling
a callto that
entry.Input
parameters are passed
from
the
invoker
to
the
accepter atthe
start ofthe rendezvous,
and output parameters arepassed
back
to the
invoker
whenthe
rendezvous ends.Communication in
the
XMS
system[Gammage85]
is
based
onan extension of
this
local
rendezvous mechanismfor distributed
systems,
namely
remote rendezvous.The
semanticsof remote rendezvous are
nearly
identical
to that
oflocal
rendezvous,
exceptthat
parameters aretransmitted
asdata
packets over a
local
areanetwork,
andthere
is
additional communication requiredin
the
form
of acknowledgements.Figure
[2.2]
showsthe
protocolfor
remote rendezvous.To
invoke
a remote rendezvous atask
mustknow
the
interface
ofthe
remotetask
it
wishesto
communicatewith and a
task
id
for it. Remote
task
id's
may
be
obtainedfrom
a name server onthe
local
node.A
task
(server)
that
canbe
invoked
remotely
registersitself
onits
node.All
name servertasks
communicateto
exchange names andtask
id's
of registeredtasks,
sothat
any
registeredtask
canbe
invoked from
any
nodein
the
system.This
arrangement promotes aclient/server
relationship
between
tasks.
Accordingly,
"the
preferred approachfor
XMS is
to
use aclient-server modelof
the
[Gammage85]
Like
RPC,
rendezvousis
a synchronous messagepassing scheme,
andthus
it
suffersfrom
the
samelimitations
with respect
to
concurrency.Note
that
regardless of whichtask
(invoker
oraccepter) begins
the
rendezvousthere
are
two
wait statesinvolved:
priorto the
copy
ofinput
parametersto the
accepter's address space and priorto the
copy
ofoutputto the
invoker's
address space(see
figure
[2.1]).
If
an aapplication requiresnon-blocking
interactions
among
tasks,
creation of a separate communications subtaskis
required.The
subtask performsthe
interaction
onbehalf
ofits
parent.However,
it
mustthen
rendezvouswiththe
parentin
orderto
return results.Thus,
concurrency
gained at onepoint
in
the
computationis lost
during
the ensuing
rendezvous.2.4
Port-based
Communication
-ACCENT
A
port-basedcommunication
schemeis designed
to
allow asynchronous messagepassing
and a many-to-onestructure.
Ports
arethe
foundation
ofthe
CMU IPC
facility,
provided as part ofthe
ACCENT
networkOS kernel
[Rashid8l].
In
the
ACCENT system,
a portis
aFIFO
queue of messages containedin
the
kernel.
Any
processthat
can refer
to
a portby
namemay
place messagesinto
the
queue.A
processmay
remove messagesfrom
a port provided
it has
receive accessto
that
port.In
the
ACCENT
system,
only
one processhas
receive accessto
a port at atime,
although receiverights
canbe
transferred
between
processes.This
allows a processto
take
over services provided
by
another process shouldthat
processfail.
With
a slight modificationto this
paradigm ports canbe
usedestablish a
many-to-many
structure.This is
accomplishedby
allowing
multiple processesto
have
receiverights,
andproviding
a mechanismfor
viewing
messageswithoutremoving them
from
the
queue.The
problem with such messagebased
systems occursin
the
handling
offailures
andin
process synchronization.
Since
there
is
noinherent
structurein how
messages arepassed,
interdependencie3 between
processes can noteasily
be determined.
Unless
explicit measures aretaken to
ensure progressin
computations(e.g.
incorporating
time-outs
in
applications),
message-baseddeadlock
is
possible.If
a process or sitefails,
the
effects oncooperating
processes and sites
is
often not clear.This
makes errorrecovery
moredifficult.
Each
process mustdetermine
acourse of action
based only
onlocal
information,
"even
when a globalcontextmay
allow abetter
recovery
strategy"
[LeBlanc85].
What is
lacking
is
a methodfor
defining
andmanaging
system-wideinteractions between
the
variouselements
involved
in
adistributed
computation.More
recent research effortsin distributed
computing
have focused
on
precisely
this
problem.Having
outlined somebasics
ofIPC
facilities,
it
shouldbe
noted againthat the
addition of communicationmechanisms
to physically
distributed
hardware does
not make adistributed
processing
system.Rather,
IPC facilities
provide
the foundation
upon whichdistributed
systems managementis
built.
Figure
2.1
-Rendevous
Event Sequence
(A)
Accepter
First
INVOKER
ACCEPTER
Accept
Invoke
>
Wait
Copy
Input
Parameters
Start Rendevous
Wait
x-Copy
Output Parameters
End Rendevous
(B)
Invoker
First
INVOKER
ACCEPTER
Invoke
Wait
>
Copy
Input Parameters
Wait
Start Rendevous
<r
Copy
Output
Parameters
INVOKER
ACCEPTER
Invoke
(Input Parameters)
ack
Reply
(Output Parameters)
ack
Figure 2.2
Chapter Three
Recent Systems
Recent
related workin distributed
computing
supporthas focused
onthe
following
areas:1)
Database
management,
2) Operating Systems,
3)
Real-time
processcontrol,
4) Programming
Languages
This
paper will concentrate onoperating
system and real-time projects.Database
systems areprimarily
ofinterest
because
oftheir
use ofthe transactions
the
precursorto
atomic actionsin operating
systems.The
transac
tion
model willbe
examinedin
this
contextin
alater
section.However,
a completediscussion
ofthe
recentdevelop
ments
in Database Management
Systems is beyond
the
scope ofthis thesis.
Similarly,
programming
languages
willbe
considered
only
to the
extentthat
certaindevelopers have integrated
a particularlanguage into
their
systems.Details
ofthese
and otherlanguages for distributed
systems willbe
notbe discussed here.
Although
developments in databases
anddistributed
operating
systems"seem
to
be
merging"[Moss85],
there
are nevertheless
fundamental
differences
in
the
reliability
(synchronization
andrecovery)
requirementsfor
eachtype
of system and
thus
in
the techniques
usedfor
achieving these
requirements.These differences
arisefrom
the
natureof
the
basic
objects andtheir
operationsin
eachtype
of system.The
section entitled"Operating
Systems:
Objects
and
Actions"
will
treat this
subjectin detail.
In
sodoing,
we will seehow
traditional
operating
system anddatabase
techniques
mustbe
modifiedto
meetthe
needs ofdistributed
systems.The
use ofobject/transactiontechniques
in
real-time applications necessitates somefurther
modifications.In
considering distributed
processcontrol,
synchronization of actionsbecomes
anincreasingly
important factor. In
suchsystems,
partial or eventotal ordering
of eventsis
often not sufficient.Instead,
real-time synchronization of operations
is
required.This
requirementimposes
additional performance constraintsonthe
support system.It
alsoimplies
the
establishment of some mechanismfor
global clock synchronization.Discussions
of real-time systemsin
this
paperwill assume
(whenever
necessary)
that
such a mechanism exists.Clock
synchronizationis discussed
elsewherein
[Lamport78],
[Lamport82]
and[Marzullo85].
Before
describing
particular research projectspresently
underdevelopment,
I
willexaminethe
two
modelsthat
areprevalent
in
currentdistributed
systems research: objects andtransactions.
3.1
The Object Model
Objects
canbe
viewed as abstractionsof system components.These
components possess certaincharacteristic,
invariant properties
that
determine
their
behavior.
An
object canonly
be
manipulatedby
a set of operationsthat
preserve
these
properties.Thus,
in
effect, the
behavior
of an objectis defined
by
its
operations.A
queueobject,
for
example,
might wellbe
represented asfollows:
It
containsthe
actual queue asdata.
It has
operations "enqueue"to
add an
item,
and"dequeue*
to
remove anitem. In
addition,
it
possessesthe
invariant
property
that
no moreitems
can
be
removedfrom
the
queuethan
have been
addedto
it.
The
principal reasonsfor
adopting
the
object model aremodularity, simplicity,
protection,
synchronization andrecovery.
Much
researchhas been done in
the
first
three
aspects ofobject-based programming.More
recently, mainly
in
the
context ofdeveloping
distributed
operating
systems,
researchershave
begun
to
look
atthe
advantages provided
by
the
object-oriented approachin
the
areas ofconcurrency
controland recovery.The
object model providesmodularity
by
encapsulating
data
and operationsin
a single entity.Details
ofimple
mentation,
both
ofdata
structures and ofthe
algorithms usedby
operations,
arehidden behind
the
objectboundary.
The
object modelpromotessimplicity
,especially
atthe
level
ofsystemdevelopment.
Object
types
and operations
canbe
used without regardto
data
representations andimplementation
details. At
the
sametime,
objectscorrespond
to
real world entities whosebehavior is
reasonably
well understood.Thus,
systemdesign becomes
primarily
amapping
processbetween
the
goals ofthe
system andthe
appropriate objects.Object-based
programming
also makes
definition
ofnew modules simplerby
virtue ofinheritance.
New
objecttypes
canbe
defined
simply
by
specifying
how
they
differ
from
existing,
more generictypes,
withouthaving
to
'start
from
scratch' eachtime.
Protection facilities
are providedby
anoperating
systemto
constrainthe
way
information
canbe
used andmodified.
A
simple and straightforward mechanismfor
controlling
manipulation of objectsis
to
place restrictions onaccess
to
an object's operations.Rights
or capabilitiesto
perform operations are grantedonly
to those
who shouldbe
able
to
accessthat
object.The
objectconcept represents apowerfulrecovery tool.
Each
object canbe
programmedto
handle
failures,
andthe
encapsulationofobjects providesfor failure
containment.Lastly,
synchronizationfacilities
are also affectedby
the
adoption ofthe
object model paradigm.Under
such asystem,
synchronization constraints are expressedin
terms
of permissible operation sequences onobjects.This
notionforms
the
foundation for
path expressions(described
below). In
actualimplementation,
synchronizationmay
be
provided
statically
by
the
language
system ordynamically by
the operating
system.The
following
is
an overview ofcommonly
used methodsfor
implementing
synchronization of accessto
objects:Semaphores
canbe
usedin
solving
general synchronizationproblems,
involving
protection of resourcesinside
critical regions.
The
mechanism requiresthat
processes share accessto
acommon semaphorevariable, say
"s". Each
process must execute an atomic operation
P(s)
before
entering the
critical section.A
processis blocked
if
the
currentresource count associated with s
is
0.
Otherwise,
the
process proceeds andthe
resource count associated with sis
decremented.
Each
process must execute an atomic operationV(s)
before
leaving
the
critical section.This incre
ments
the
resource count associated with s and allowsblocked
processesto
enter.If
thi3
sequenceis
notfollowed,
synchronization errors
may
result.Note
that this
problem will ariseif
even a single processdoes
notfollow
the
correct procedure.
Like
semaphores,
conditional critical regions canbe
usedin
solving
general synchronization problems.Condi
tional
criticalregionstake the
form
regionv whenB do
S;
whereB is
aboolean
expression,
vthe
sharedvariable,
andS
the
statement(s)
to
be
executed.When
a process entersthe
criticalregion,
the
expressionB is
evaluated.If B is
true,
S is
executed;
otherwisethe
processis delayed
untilB becomes
true
andnoother processis in
the
region associated with v.
The
main problem with conditional critical regionsis
that the
conditions "B"must
be
evaluatedvery
frequently
and withinthe
context ofthe caller,
unlessrestrictions are put onB. This
evaluation must occur:-
for deadlock
avoidance,
if
a processleaves
the
region oris
blocked
by
another waitclause,
-
for
minimalblocking,
afterevery
changeofstatevariables[Lagally79].
Whereas both
semaphores and conditional critical regions require each procedureto
provideits
own synchronization
explicitly,
monitors provide mutual exclusion synchronization automatically.The
monitor construct containsboth data
and procedures neededfor
allocating
its
resources.Monitors
ensure mutual exclusionby
allowing exactly
one process at a
time to
enter.Interaction
among
processessharing
the
monitoris
providedthrough
signal and waitoperations.
The
operation"wait
(condition)"
blocks
the
calling
process and placesit in
a queue associated with'condition'.
The
operation'signal(condition)
"releases a processfrom
the
'condition'queue and allowsit
to
enterthe
monitor.
The
main problem occurs withnesting
of monitor calls and concernsthe
semantics oflocking.
If
monitorsare
nested,
processesmay
be blocked unnecessarily;
this
is due
to
the
fact
that
monitorsautomatically
providemutual exclusion on
the
data
object,
whereas mutual exclusion onthe
state variables would suffice.A
path expressionhas
the
form
pathS
end, whereS
denotes
alegal
sequenceof execution steps.This
sequenceis
described
according to the
following
syntax:-
S
=S1;S2
meansthat
the
subsequenceSi
mustbe followed
by
S2
and vice-versa.-
S
=S1,S2
meansthat
eitherSi
orS2
mustfollow.
-
S
={Si}
meansthat
afterSi has been
initiated,
anarbitrary
number ofinstances
ofSI
may
occur.Only
after all
instances have
completedmay
other steps proceed.-
S
=(Sl
-S2)
meansthat the
sequenceSl
must occur atleast
as often asS2,
but
not morethan
"n"times
more often.
Path
expressionsmay
be
translated
into
an equivalent sequence ofP
andV
operations and arethus
logically
equivalent
to
semaphores.One
ofthe
maindrawbacks
ofpath expressionsis
that the
identity
ofthe
calling
processis
not apartofthe
description.
If
thestate ofthe
objectdepends
onthe
relationshipsbetween
processesaccessing
it,
the
formulation
ofthe
appropriatepathexpressionbecomes
unclear[Lagally79].
The
object manager constructis
more recentthan those previously
described,
andit fits
mostnaturally
withboth
distributed
systems and the object modelitself.
In
this approach,
a process called an"object
manager"
is
associated with each object.
The
manager controls accessto the
objectin
an applicationdependent
manner,
including
handling
synchronization.(In
some ofthe
systems we willdiscuss,
object managers alsoplay
animportant
rolein
recovery).
Object
managers represent animprovement
overtraditional operating
system synchronization methodsfor
anumber of reasons
[Lagally79]:
-
Conditional
critical regionsandpath expressionsuseonly
alocalized
view ofthe
data
objects.As
aresult,
global
considerations,including
scheduling
ofoperations andfreedom
from
deadlocks,
cannotbe
expressedin
anatural way.
-
Nesting
ofMonitor
calls orCritical
Regions
canlead
to
unwanted sequentialization.-
In
a systemthat
uses object
managers,
processes areloosely-coupled.
This
methodis
thus
more appropriatefor
adistributed processing
environment.-
In
allthe
synchronization mechanisms
mentioned,
except objectmanagers,
access operations are called as procedures
from
the calling
process.If
a processis
preempted whileexecuting the operation, the
objectmay
be
locked indefinitely.
Use
of object managersis
the
only
methodthat
provides a solutionto this
problem.Since
actual
invocation
of object operationsis handled
by
the
objectmanager, the
objectis
notkept locked if
a useris
preempted whileaccessing
it.
While
each object canbe
programmedto
handle
synchronization andrecovery
from
alocal
perspective,
objectsdo
not workin
isolation,
but
rather as components oflarger
systems.Thus,
given an object-orientedprogramming
environment,
it is
clearly
desirable
to
have
a mechanismfor
defining
relationshipsbetween
objects andfor
controlling
their
interactions.
Transactions
(or
in
operating
systemterms,
'actions')
provide this mechanism.3.2 Transactions
A
transaction,
in
database
systems,
refersto
a sequence of operations ondatabase
objectsthat,
whenfinished,
preserve
their consistency
constraints.Transactions
possessthe
following
properties:-
Failure
atomicity
(Totality):
Either
all or none of atransactions
operations are performed.If
atransaction
does
notcomplete,
its
partial results are undone so asto
insure
that
it
has
no undesired side effects.-
View
atomicity
(Concurrency
transparency):
A
transaction
appearsto take
placeindivisibly,
without concurrent
interference,
and anincomplete
transaction
cannot revealits
resultsto
othertransactions.
This
prevents
'cascading
aborts'in
casethe transaction
mustlater be
undone,
andthus
providesfor failure
containment.
These first
two
properties are often referredto together
andtermed simply
"atomicity".
However,
it
willbe
useful
in future
discussions
todistinguish between
them.That
is,
between undoing
atransaction's
unsuccessfuloperations and
"hiding"
partial results of operations
from
othertransactions.
-
Permanence:
If
atransaction
completessuccessfully,
the
results ofits
operations will notsubsequently
be
undone.
-
Serializability:
If
several transactions executeconcurrently, their
effect onthe
database is
the
same asif
they
were executed
serially according to
somecorrectschedule.Transactions
arerunconcurrently,
withtheir
operationsinterleaved. An interleaved
execution oftransactions
is
known
as a schedule.The
schedulerortransaction
manageris
responsiblefor
safeguarding the consistency
ofthe
database
by
producing
only
correct schedules.A
scheduleis
correctif it
satisfiesthe
following
conditions:(l)
There
exists a
total ordering
ofthe
set oftransactions,
and(2)
For
every
pairofconflicting
operations(i.e.
operationsthat
access
the
sameobject),
their
relative order onthe
shared objectis
the
same astheir
corresponding
orderin
the total
ordering
oftransactions
[Papadimitriou86],
This
theoretical
resultis
canbe
realized with eitherlocking
ortimestamps.
If
locking
is
used, then the
following
test
producesthe
desired
result:A
transaction step may proceed,
unless
it
conflicts with a previousstep
of another activetransaction.
To
carry
outthe
test,
the
scheduler checkswhether
any
incomplete
transactions hold locks
to the
objectthat
areincompatible
withthe
current operation.If
timestamps
areused, the
following
mechanismmay
be
applied:A
step may
proceedif
the
timestamp
ofits
transac
tion
is larger
than the
timestamp
ofthe
object accessed.If
the
step proceeds, the
timestamp
ofthe
object accessedis
updated
to
the
timestamp
ofthe
transaction.
In
eithercase,
the
effectis
the
same:The
schedulermay
be
requiredto
delay
the
execution of atransaction
in
orderto
preserve serializability.In Database Management
Systems,
the
purpose oftransaction
manageror scheduleris
to
maintainconsistency
constraints on stored
data,
withoutunduly restricting
concurrency.In
operating
systems,
onthe
otherhand,
the
goal
is
to
maximize parallelism and resource utilization.As
we shallsee,
it is
possiblein
anoperating
system contextto
formulate
non-serializabletransactions
(actions)
thatimprove
concurrency
whilemaintaining
consistency
requirements.
Thus,
in
orderto
extendtransactions to
anoperating
system environment several modificationsto the
modelmust
be
made.3.3
Operating
Systems: Objects
andActions
First
we must considerthe
nature of objectsin
the
operating
systemcontext,
as opposedto
that
of adatabase
system.
In
particular,
we are concerned withtheir
operations andrecoverability
properties.The basic
objectsin
adatabase
system consist ofrecords collectedinto files. The
only
operations on records are read andwrite,
andonly
operations such as
insert, delete, lookup
and sort(which
aresimply
variations on read andwrite)
aredefined for files.
[Spector]
Moreover,
database
objects canbe
restoredin
the
event of an actionfailure.
Operating
system objectstypi
cally
represent system resources: physical entities such asdisk drives
or printers anddata
abstractions such asdirec
tories
or queues.In
orderto
providefor data
abstraction,
the
system must supportarbitrary
objecttype
definitions
with
corresponding
type- specificoperations, instead
ofsimply
read andwrite.Moreover,
in operating systems,
not allobjects are recoverable.
A
resourceis
non-recoverableif its
use changesits
stateirrevocably.
Changes
to
suchobjects cannot
be deferred
untilcommit,
norcanthey
be
undone upon abort.Examples
of such objectsin
operating
systems
include disk
sectors,
tape
drives,
printers andbuffers
[McKendry84].
Recoverability
ultimately
rests onlevel
of abstraction of
the
object:The
questionis
essentially
one of abstract versus physical entities.For
example,
the
value of a
bank
balance may
be
temporarily
suspendedbetween
old and newversions, pending
the
completion of atransaction.
If
the transaction
commits,
the
newversionbecomes
the
"real" value.If
the
transaction aborts,
the
oldvalue
may
be
restored.The
use ornon-useof adisk
sectorcan notbe
similarly
suspended.The
effects ofits
use areimmediate: Once
written, the
valueautomatically
becomes
the
current versionfor
that
sector andthe
previous version
is
lost.
Under
these circumstances, recovery
mechanisms usedby
database
systems(i.e.
undoing
andredoing
transactions)
cannotbe
applied.Next,
we must considerthe
difference
between
atomic actions anddatabase
transactions.
In database
systems,
transactions
useonly
syntactic andvery
limited
semanticinformation
(i.e.
conflictknowledge)
in
orderto
achieveserializability.
In
operating
systems,
greaterconcurrency
canbe
achievedby
using
additional semanticknowledge
both
about objects and aboutthe
properties oftransactions
in
whichthey
areinvolved.
For
example,
in
orderto
realize
concurrency
transparency,
it
is
not alwaysnecessary
that
execution of atomic actionsbe
serializable[McKendry84],
[Spector],
[Allchin83]
The
following
examples serveto
illustrate
this
point:(1)
Consider
a queuethat
buffers
units of workbetween
producer and consumertransactions.
Serializing
the
transactions that
operate onthe
buffer
requiresthat
all entriesmadeby
a singletransaction
be
removedin
the
orderof entry.
(In
otherwords,
consecutiveremoval ofitems
is
enforced).However,
in
many
producer/consumer
problemsof
this
kind
the
queue need notbe
treated
asstrictly
FIFO
(i.e.
a weak queuemay
be
more appropriate).So
long
asentries
for
whichthe
inserting
transaction
has
committed areeventually
removedfrom
the
queue,
anditems inserted
by
abortedtransactions
are notremoved, atomicity
is
maintained[Spector].
(2)
Suppose
wehave
a storagemap
objectS
whose purposeis
to
allocatedisk
pagesto the
user.S has
two
operations:
Get()
andPut(). Get
examinesthe
current state ofthe
map
and returns afree
pageif
oneis
available.Put
returns acurrently
allocated pageto the
map.Consider
the
following
sequence of eventsinvolving
actionsAl
and
A2:
Al
requests aGet()
andis
allocated page piA2
requests aGetQ
andis
allocated page p2Al
requests aGetQ
andis
allocated page p3Ignoring
the
user view(abstract
level)
andconsidering only the
implementation
view(physical
level),
serializability
requirementsdictate
that this
sequence notbe
allowed,
sinceit
violatesthe
relativeordering
condition.The
transaction
Al
mustbe
allowedto
complete without concurrentinterference from A2
andthus
mustbe
allocatedconsecutive pages.
This
problem arisesbecause,
from
the
implementation
standpoint,
not all pages areidentical.
From
the
standpoint ofthe
user,
however,
this
interleaved
sequencemay
be
consideredacceptable,
because it
allocates
the
pages as requested.Thus,
viewatomicity
is
maintained atthe
abstractlevel despite
non-serializability
atthe
physicallevel [Allchin83].
The
key
difference between
actionsin
anoperating
system anddatabase
transactions is
the
absence ofthe
serializability
requirementin
the
former.
In
discussing
actions,
therefore,
we willbe
concerned withthe
two atomicity
properties:
concurrency
transparency
(view
atomicity)
andtotality (failure
atomicity).View
atomicity
is linked
to
synchronization,
whilefailure
atomicity
is
the
concern ofthe recovery
mechanism.Allchin defines
three
different
types
of synchronizationthat
mustbe
consideredin
an action/object environment[Allchin83]:
1)
process synchronization:Access
to
shared objects often mustbe
synchronizedin
orderto
provide mutualexclusion.
For
example,
solutionsto
the
classical readers/writers problem require writersto
exclude each otherduring
the
write operation.As
wehave
seen, traditional operating
systemtechniques
for
providing
mutualexclusion
may
notbe
appropriatefor
adistributed
environment.2)
actionatomicity
synchronization:Synchronizing
accessto
objectsdepends
notonly
onthe
currentaction,
but
also onincomplete
(uncommitted)
actionsinvolving
those
objects.Whereas
process synchronization canbe
viewed at
the
objectlevel,
atomicity
synchronization requiresknowledge
of actiondependencies.
In
orderto
insure
atomicity,
either an optimistic or a pessimisticconcurrency
control mechanismmay
be
used.In
a pessimisticapproach,
concurrency
controlis invoked
when operations are requested.Execution
ofthe
operation
is
delayed,
if
necessary,
untilthe
completion of other concurrent atomic actions.In
the
optimisticapproach,
an actionis
allowedto
perform operations withoutconstraint,
andconcurrency
controlis invoked
atcommit
time.
At
that
time,
the
effects ofthe
action onits
objects are evaluated.The
actionis
allowedto
complete
only
if
doing
sodoes
not violatethe
objects'consistency
constraints.An
optimistic approachis
appropriateif
concurrent atomic actions conflict with each otherinfrequently. Con
versely,
a pessimistic approachis
appropriateif
conflicts are morelikely. The
use of an optimistic scheme undersuch conditions would
lead
to
an excessive number of aborts[Natarajan85].
3)
operation ordering:In
additionto
the
synchronization requiredfor
atomicity,
it
may
be
necessary
to
orderthe
execution ofobject operations.For
example,
aqueue object requiresthat
atleast
one enqueue operationcompletes
before
adequeue
canbe
performed.This
type
ofsynchronizationis
necessitatedby
the
semantics ofabstract
data
objects.It
may,
like
actionatomicity synchronization,
requireknowledge
ofactiondependencies.
Recovery
is
necessitatedby
a number ofpossiblefactors, including
explicit abortsby
user processes andimpli
cit aborts caused
by
systemfailures
(such
asdeadlock
orhardware
failure).
As in
the
case ofconcurrency control,
either an optimistic or a pessimistic mechanism
may
be
used.In
a pessimisticapproach, the
present state of anobject
may
notbe
altered untilit has been determined
that recovery
willnotbe
needed.Pessimistic
recovery
is
typi
cally implemented
using
shadowing.An
object's shadow containsthe
new valuesthat
areto
be
assignedto the
object,
providedthe
action commits.An
optimisticrecovery strategy
permits objectsto
be
modified,
and recordssufficient
information
to
undothe
effects ofan aborted action(i.e.,
to
restorethe
former
state of objects).In
addition,
the
systemmay
storeinformation
in
orderto
redo operations.Optimistic
recovery
is
usually
implemented
using
logging
The logs hold
old object stateinformation,
andoptionally,
forward
recovery
information.
3.4
The Role
ofProcesses
In
the
'abstract'objectmodel, the
data
structures within objects aredefined
as passive. 'Processes'or 'modules'are what
invoke
the
operations ofthe
system.The
precise role of processesis
not welldefined in
the
object modelitself
andtypically
differs
depending
onthe
implementation
(as
willbe
seenin
the
systemsdiscussed later in
the
chapter).
In
systems where synchronization of accessto
objectsis
providedby
object managersthere
is
a set of specialprocesses
(or
modules)
associated with objectsthat
providethis
function.
These
processes aredistinct
from
those
processes
that
are associated with applications.The
execution ofthese
processes canbe
seen as"representing"
(trans)
actions[LeBlanc85].
Whether
application processesinteract
directly
with objects orthrough
somemediating
processes
(such
as objectmanagers)
is
afunction
ofthe
implementation.
3.5
Active
vs.Passive
Objects
As
previously
noted,
the
object modeldefines
objects as passive entities.The
classification of objectsin
certainsystems as
"active"
arises
from
one oftwo
conditionsand,
like
the
role ofprocesses,
is implementation dependent:
(l)
Objects
that
areautomatically
associated with a manager process aretypically
classified asactive,
althoughthis
represents a somewhatless
clear cut casethan
the
second condition.(2)
Processes
(modules)
may simply
be
regardedby
definition
as objects.This
represents adeparture from
the
original object model.
It is important
to
notethat this
does
notimply
that
(tra.ns)
actions are objects.Rather
the
processes
that
initiate
them
may
be
considered as such.Having
outlinedthe
issues involved in
building
supportsystemsfor
distributed
programming,
anddiscussed
the
two
principle paradigms usedin
their
construction(objects
andactions),
let
us examine some projectscurrently
under
development.
3.6
Cronus
The Cronus
Operating System,
currently
underdevelopment
atBolt
Berenak
k Newman
Inc.,
is
a prime example of
the
use ofobject-orientedtechniques
in
building
a reliabledistributed
operating
system.Following
the
objectmodel,
allCronus
system activities canbe
expressed as operations on objects(which
are organizedinto
classes or"types").
System
components such asprocesses,
directories,
andfiles
are examples oftypical
Cronus
objects.Each
object
in
the
systemhas
a manager process.Because
ofthis,
andbecause
processesthemselves
aredefined
asobjects,
Cronus
objects are considered active.A
type
manager process on aCronus host
manages all objects of a giventype
thatreside on
the
host. These
managers,
taken
collectively,
handle
the
resources representedby
that type
for
the
system
as a whole.Binding
of a managerto
an objectfor
a particular operationis
accomplisheddynamically
[Schantz86].
The dynamic
binding
of client requeststo
appropriate object managers providesfor
efficiency
andflexibility
in
the
network context.Some
objects can migrateto
allowfor
systemreconfiguration,
while others are replicatedto
support availability.
Support
for location
transparency
permits operationinvocation
tobe
independent
ofthe
sitesor
the
client andthe
objectbeing
accessed.Much
attentionhas been
paidin
Cronus
to
(l)
providing
built-in
managersfor
standardDistributed
Operating
System
services such asfile, directory,
and process managers and authenticationservices,
and(2)
creating
tools
for
automated object managergeneration.
This
reflectsthe
developers'focus
onthe
object model asthe
primary
concernin distributed
systemsdevelopment:
First,
sincedeveloping
application-defined objectsis
central tothe
Cronus
philosophyo