Paradigms & Patterns - 3Token-Passing AlgorithmsBenefits of Token-Passing AlgorithmsMicrokernel PatternContext & ProblemForcesSolutionCRC CardsMore CRC cardsStatic RelationshipsScenario IScenario IIVariantAnother Variant – Distributed Microkernel SystemExamplesConsequences10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 81Paradigms & Patterns - 3ECEN 5053 SW Eng of Distributed SystemsUniversity of Colorado, Boulder10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 82Token-Passing AlgorithmsA token is a special kind of message used to convey informationsynchronize access to replicated filesachieve conflict resolution that is fairdetermine global states in distributed computationsUsing two tokens in opposite directionsSolve distributed mutual exclusionCan bypass a failed nodeCan regenerate a lost token10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 83Benefits of Token-Passing AlgorithmsEasy to generalize to synchronization solutionsCompared to distributed semaphoresDecentralized and fair, tooToken-passing requires far fewer messages10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 84Microkernel PatternFound in POSA 1, pp. 171-192Also found in Real-Time Design Patterns: Robust Scalable Architecture for Real-Time Systems, Bruce Powel Douglass, Addison Wesley, 2003.The Microkernel architectural pattern applies to software systems that must be able to adapt to changing system requirements. It separates a minimal functional core from extended functionality and customer-specific parts. The microkernel also serves as a socket for plugging in these extensions and coordinating their collaboration.10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 85Context & Problem Context: The development of several applications that use similar programming interfaces that build on the same core functionality. Problem: Want to develop software for an application domain that needs to cope with a broad spectrum of similar standards and technologies. Systems like operating systems and GUI’s often have a long life-span. New technologies emerge; old ones change.10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 86ForcesApplication platform must cope with continuous hw and sw evolutionApplication platform should be portable, extensible, and adaptable to allow easy integration of emerging technologiesApplications in the domain need to support different but similar application platforms. The applications may be categorized into groups use the same functional core in different waysrequire the underlying application platform to emulate existing standards.Functional core separate component with minimal memory size and services that consume as little processing as possible10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 87SolutionEncapsulate fundamental services in a microkernel component.Internal servers contain core functionality that cannot be implemented in the microkernel without causing an unnecessary increase in size or complexity.External servers implement their own view of the underlying microkernel using mechanisms available through the interfaces of the microkernel. Every external server is a separate process that represents an application platform. A microkernel system is an application platform that integrates other application platforms.Clients communicate with ext. servers using comm facilities provided by microkernel10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 88CRC CardsClass CollaboratorsMicrokernel Internal serverResponsibilityProvides coremechanismsOffers communi-cation facilitiesEncapsulates sys-tem dependenciesManages andcontrols resourcesClass CollaboratorsInternal server MicrokernelResponsibilityImplementsadditional servicesEncapsulates some system depen-denciesClass CollaboratorsExternal server MicrokernelResponsibilityProvides program-ming interfaces forits clients.10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 89More CRC cardsClass CollaboratorsClient AdapterResponsibilityRepresents anapplicationClass CollaboratorsAdapter External server MicrokernelResponsibilityHides system depen-dencies such as communication facilities from theclient.Invokes methods ofexternal servers onbehalf of clients10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 810Static RelationshipsExternal ServerreceiveRequestdispatchRequestexecuteServiceMicrokernelexecuteMechanisminitCommunicationfindReceivercreateHandlesendMessagecallInternalServerAdaptercreateRequestcallServiceClientdoTaskInternal ServerreceiveRequestexecuteServiceinitializescommunicationsends requestcalls service10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 811Scenario I10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 812Scenario II10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 813VariantMicrokernel System with indirect Client-Server connections. A Client and Server communicate with each other indirectly using the microkernel as a message backbone. All requests pass through the microkernel. Useful when security requirements force the system to control all communication between participants.10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 814Another Variant – Distributed Microkernel SystemA microkernel acts as a messaging backbone responsible for sending messages to remote machines or receiving messages from them. Every machine in the distributed system uses its own microkernel implementation. From the user’s viewpoint, the whole system appears as a single Microkernel system – distribution is transparent. A Distributed Microkernel System allows you to distribute servers and clients across a network of machines or microprocessors. The microkernels in a distributed implementation must include additional services for communicating with each other.10-16-2006 ECEN 5053, Paradigms & Patterns, Wk 815ExamplesWindows NT and 4 others in POSADouglass says: an RTOS is common subsystem Core set of services include create and delete a task, allocate and deallocate memory, provide task event & message queues, and schedule/execute a task set. Plus, a developer can link in additional components to provide more services. Common service components for RTOS include bus communications, file services, networking services, and middleware services. Thus an RTOS becomes usable in a much wider set of application problems from tiny, highly
View Full Document