Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
DevelopingDistributedRTSystems
UsingOSSystem-HidingFrameworks
DouglasC.Schmidt
AssociateProfessorElec.&Comp.Eng.Dept.
[email protected],Irvine
www.ece.uci.edu/�schmidt/(949)824-1901
Sponsors
NSF,DARPA,ATD,BBN,Boeing,Cisco,Comverse,GDIS,Experian,GlobalMT,
Hughes,Kodak,Krones,Lockheed,Lucent,Microsoft,Mitre,Motorola,Nokia,Nortel,
OCI,Oresis,OTI,QNX,Raytheon,SAIC,SiemensSCR,SiemensMED,SiemensZT,
Sprint,Telcordia,USENIX
ACEOverviewDouglasC.Schmidt
Motivation:theDistributedRT
CommunicationSoftwareCrisis
BOARD BOARD 11
VME VME
1553 1553
BOARD BOARD 22�Symptoms
{Hardwaregetssmaller,faster,
cheaper
{Softwaregetslarger,slower,
moreexpensive
�Culprits
{Accidentalandinherent
complexity
�Solutions
{Frameworks,components,and
patterns
UCIrvine1
ACEOverviewDouglasC.Schmidt
TechniquesforImprovingSoftware
QualityandProductivity
APPLICATION APPLICATION
SPECIFIC SPECIFIC
LOGIC LOGIC
USER USER
INTERFACE INTERFACE
(A) CLASS LIBRARY ARCHITECTURE
NETWORKING
MATHADTS
DATA
BASE
MATH
(B) FRAMEWORK ARCHITECTURE
ADTS
INVOKES
INVOKES
EVENT
LOOP
APPLICATION
SPECIFIC
LOGIC
CALL
BACKS
NETWORKINGUSER
INTERFACE
DATABASE
EVENT
LOOP
�Provensolutions
{Components
�Self-contained,\pluggable"
ADTs
{Frameworks
�Reusable,\semi-complete"
applications
{Patterns
�Problem/solutionpairsina
context
{Architecture
�Familiesofrelatedpatterns
andcomponents
UCIrvine2
ACE Overview Douglas C. Schmidt
Roadmap to Levels of Middleware Abstraction
INFRASTRUCTUREMIDDLEWARE
DISTRIBUTIONMIDDLEWARE
COMMONMIDDLEWARE
SERVICES
APPLICATIONS
Cons
ConsConsEVENTEVENTCHANNELCHANNEL
OPERATINGOPERATINGSYSTEMS SYSTEMS &&PROTOCOLSPROTOCOLS
HARDWAREHARDWARE DEVICESDEVICES
� Observations
{ Historically, apps built directly
atop OS
{ Today, more and more apps
built atop middleware
{ Middleware has several layers
� General R&D challenges
{ Performance optimizations
{ Quality of Service (QoS)
{ Software architecture &
patterns
UC Irvine 3
ACE Overview Douglas C. Schmidt
Why We Need Communication Middleware
� System call-level programming is wrong abstraction for
application developers
{ Too low-level ! error codes, endless reinvention
{ Error-prone ! HANDLEs lack type-safety, thread cancellation woes
{ Mechanisms do not scale ! RTOS TSS
{ Steep learning curve ! Win32 Named Pipes
{ Non-portable ! socket bugs
{ Ine�cient ! i.e., tedious for humans
� GUI frameworks are inadequate for communication software
{ Ine�cient ! excessive use of virtual methods
{ Lack of features ! minimal threading and synchronization
mechanisms, no network services
UC Irvine 4
ACE Overview Douglas C. Schmidt
The ADAPTIVE Communication Environment (ACE)
PROCESSES//THREADSTHREADS
DYNAMICDYNAMIC
LINKINGLINKING
MEMORYMEMORY
MAPPINGMAPPING
SELECTSELECT//IO COMPIO COMP
SYSTEMSYSTEM
VV IPCIPCSTREAMSTREAM
PIPESPIPES
NAMEDNAMED
PIPESPIPES
CAPISS
SOCKETSSOCKETS//TLITLI
COMMUNICATIONCOMMUNICATION
SUBSYSTEMSUBSYSTEM
VIRTUAL MEMORYVIRTUAL MEMORY
SUBSYSTEMSUBSYSTEM
GENERAL POSIX AND WIN32 SERVICES
PROCESSPROCESS//THREADTHREADSUBSYSTEMSUBSYSTEM
FRAMEWORKS ACCEPTORACCEPTOR CONNECTORCONNECTOR
SELF-CONTAINEDDISTRIBUTED
SERVICE
COMPONENTS
NAMENAME
SERVERSERVER
TOKENTOKEN
SERVERSERVER
LOGGINGLOGGING
SERVERSERVER
GATEWAYGATEWAY
SERVERSERVER
SOCKSOCK__SAPSAP//TLITLI__SAPSAP
FIFOFIFO
SAPSAP
LOGLOG
MSGMSG
SERVICESERVICE
HANDLERHANDLER
TIMETIME
SERVERSERVER
C++WRAPPER
FACADES
SPIPESPIPE
SAPSAP
CORBACORBA
HANDLERHANDLER
SYSVSYSVWRAPPERSWRAPPERS
SHAREDSHARED
MALLOCMALLOC
THE ACE ORBTHE ACE ORB
((TAOTAO))
JAWS ADAPTIVEJAWS ADAPTIVE
WEB SERVERWEB SERVER
MIDDLEWARE
APPLICATIONS
REACTORREACTOR//PROACTORPROACTOR
PROCESSPROCESS//THREADTHREAD
MANAGERSMANAGERS
STREAMSSTREAMS
SERVICESERVICE
CONFIGCONFIG--URATORURATOR
SYNCHSYNCH
WRAPPERSWRAPPERS
MEMMEM
MAPMAP
OS ADAPTATION LAYER
http://www.cs.wustl.edu/�schmidt/ACE.html
� ACE Overview
{ A concurrent OO
networking
framework
{ Available in C++
and Java
{ Ported to
VxWorks, POSIX,
and Win32
� Related work
{ x-Kernel
{ SysV STREAMS
UC Irvine 5
ACEOverviewDouglasC.Schmidt
ACEStatistics
�ACEcontain>200,000linesofC++
{Over30person-yearsofe�ort
�PortedtoUNIX,Win32,MVS,and
embeddedplatforms
{e.g.,VxWorks,LynxOS,Chorus,
pSoS,QNX
�Largeusercommunity
{www.cs.wustl.edu/�schmidt/ACE-
users.html
�Currentlyusedbydozens
ofcompanies
{Boeing,Cisco,
Ericsson,Kodak,
Lockheed,Lucent,
Motorola,Nokia,
Nortel,Raytheon,
SAIC,Siemens,
StorTek,etc.
�Supportedcommercially
{www.riverace.com
UCIrvine6
ACEOverviewDouglasC.Schmidt
PatternsforCommunicationMiddlewareEvent
PatternsConcurrency
Patterns
ExternalPolymorphism
WrapperFacade
Connector
Acceptor
ThreadPool
Thread-perSession
Thread-perRequest
AsynchronousCompletion
Token
ThreadSpecificStorage
ActiveObject
Half-Sync/Half-Async
Leader/Followers
ServiceConfigurator
Object LifetimeManager
Reactor
Proactor
DoubleCheckedLocking
Thread-Safe
Interface
ScopedLocking
StrategizedLocking
InitializationPatterns
SynchronizationPatterns
�Observation
{Failuresrarelyresult
fromunknownscienti�c
principles,butfrom
failingtoapplyproven
engineeringpracticesand
patterns
�Bene�tsofPatterns
{Facilitatedesignreuse
{Preservecrucialdesign
information
{Guidedesignchoices
UCIrvine7
ACEOverviewDouglasC.Schmidt
Use-casesforACEandTAO
APPLICATIONS APPLICATION APPLICATION--SPECIFIC SPECIFIC
APPLICATION APPLICATION--INDEPENDENT INDEPENDENT
APPLICATIONS APPLICATIONSAPPLICATIONS APPLICATIONS
Concurrency Concurrencyglobal global
Reactor Reactor
Service ServiceInitialization Initialization
Service ServiceConfigurator Configurator
Stream StreamFramework Framework
Interprocess InterprocessCommunication Communication
Network NetworkServices Services
�Domains
{Real-timeavionics
{Distributed
interactive
simulations
{Satellite
communication
{Network
management
{Medicalimaging
{Multimediaservices
UCIrvine8
ACEOverviewDouglasC.Schmidt
ApplyingACEtoReal-timeAvionics
REPLICATION
SERVICE
OBJECT REQUEST BROKER
1: SENSORSGENERATE
DATA
FLIR GPSIFF
3:PUSH (EVENTS)
2: SENSOR PROXIES DEMARSHAL DATA& PASS TO EVENT CHANNEL
3:PUSH (EVENTS)
EVENT
CHANNEL
HUDNavAir
FrameWTS
4: PULL(DATA)
DomainChallenges
�Deterministic&statistical
real-timedeadlines
�Periodic&aperiodic
processing
�COTSandopensystems
�Reusablecomponents
�Supportplatform
upgrades
www.cs.wustl.edu/�schmidt/TAO-
boeing.html
UCIrvine9
ACEOverviewDouglasC.Schmidt
ApplyingACEtoDistributed
InteractiveSimulations
NETWORK NETWORKOPERATIONS OPERATIONS
CENTER CENTER
HSM HSM
ARCHIVE ARCHIVE
SERVER SERVER
AGENT AGENT
INTERACTIVE INTERACTIVE
AUDIO AUDIO//VIDEO VIDEO
AGENT AGENT ARCHITECTURE ARCHITECTURE
SPC SPC
HARDWARE HARDWARE
EMBEDDED EMBEDDED
TAO TAO
MIB MIB
AGENT AGENT
www.cs.wustl.edu/�schmidt/Words99.ps.gz
UCIrvine10
ACEOverviewDouglasC.Schmidt
ApplyingACEtoSatelliteCommunicationSystems
WIDE AREA
NETWORK
SATELLITES SATELLITESTRACKING TRACKINGSTATION STATION
PEERS PEERS
STATUS INFO
COMMANDSBULK DATA
TRANSFER
LOCAL AREA NETWORK
GROUNDSTATION
PEERS
GATEWAY
www.cs.wustl.edu/�schmidt/TAPOS-
95.ps.gz
�DomainChallenges
{Longlatencysatellitelinks
{Highreliability
{Prioritization
UCIrvine11
ACEOverviewDouglasC.Schmidt
ApplyingACEtoNetworkManagement
Session RouterModule
PresentationModule
Event FilterModule
Event AnalysisModule
PresentationModule
Switch RouterModule
Reactor
MD110 MD110ERICSSON ERICSSON
TELECOM TELECOM
SWITCHES SWITCHES
SUPER SUPER
VISORS VISORS
MD110 MD110ERICSSON ERICSSON
MD110 MD110ERICSSON ERICSSON
SUPER SUPER
VISORS VISORS
SUPER SUPER
VISORS VISORS
Switch IO
Session IO
www.cs.wustl.edu/�schmidt/DSEJ-94.ps.gz
�DomainChallenges
{Lowlatency
{Multi-platform
{Familyofrelated
services
UCIrvine12
ACEOverviewDouglasC.Schmidt
LessonsLearnedBuildingACE
�Bepatient
{Goodcomponents,frameworks,
andsoftwarearchitecturestake
timetodevelop
�Reuse-in-the-largeworksbest
when:
1.Themarketplaceiscompetitive
2.Thedomainiscomplex
3.Skilledmiddlewaredevelopers
4.Supportivecorporateculture
5.\Reusemagnets"exist
6.Opensourcedevelopmentmodels
�Thebestcomponentscome
fromsolvingrealproblems
{Keepfeedbackloopstight
toavoid\runaway"reuse
e�orts
�Producereusable
componentsbygeneralizing
fromworkingapplications
{i.e.,don'tbuildcomponents
inisolation
UCIrvine13
ACEOverviewDouglasC.Schmidt
ConcludingRemarks
�Developersofreal-timecommunicationsoftwareconfrontrecurring
challengesthatarelargelyapplication-independent
{e.g.,serviceinitializationanddistribution,errorhandling,ow
control,eventdemultiplexing,concurrencycontrol,synchronization,
scheduling
�ProgrammingdirectlytotheunderlyingOSAPIsistedious,error-prone,
andnon-portable
�Successfuldevelopersresolvethesechallengesbyapplyingappropriate
designpatternstocreatecommunicationframeworks
�Applicationframeworksareane�ectivewaytoachievebroadreuseof
software
UCIrvine14
ACEOverviewDouglasC.Schmidt
ObtainingACE
�AllsourcecodeforACEisfreelyavailable
{www.cs.wustl.edu/�schmidt/ACE.html
�Mailinglists
�Newsgroup
{comp.soft-sys.ace
�Commercialsupport
{www.riverace.com
UCIrvine15