28.01.2015 Views

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.AMiniatureSystem33<br />

FIGURE2.2.StructureofaWindowSystemApplication<br />

GetProgram<br />

vokesoneoftheservices:Refocus,Kill,Create,orDispatch.Thefront-<br />

endalsokeepstrackofwhichwindow(ifany)iscurrentlyinfocus. applicationrunninginthatwindow,<strong>and</strong>(2)Quittoshutdownthewindow. managerhasapairofports:(1)InputToWindow,fordirectingdatatothe frontend.ThewindowmanagerprocessservicesWriteToWindowcallsfrom applicationssendinglinestotheirwindow.Foreachwindow,thewindow Thewindowmanagerprocesssupportsthesefourservicescalledbythe Afront-endprocessreadslinesfromtheterminal,parsesthem,<strong>and</strong>in-<br />

thewindow.WhenaQuitcallisreceived,theunboundedbuer<strong>and</strong>the passesGetProgramcalls.Boththeunboundedbuer<strong>and</strong>theadapterare preparedtoreceiveQuitcallswhenthewindowmanagerdecidestokill ItconvertsPutLinecallsintotheappropriateWriteToWindowcalls,<strong>and</strong> linestypedaheadtotheclient,<strong>and</strong>(3)anadapterprocess,Adapter.These processesareshownindetailingure2.2,TheadapterissimilartoFilter. buerprocess,similartotheBoundedBufferdescribedabovewhichstores thesamest<strong>and</strong>ardinterfacefamiliarfromHelloWorld,(2)anunbounded Eachapplicationconsistsofthreeprocesses:(1)theclientitself,with<br />

modules.Herearetheinterfacedenitionsforthewindowmanager: Oncewehavedesignedthemodulestructure,wecanwritethedenitions 2.3Interfaces adaptershutdown,isolatingtheclient<strong>and</strong>thusterminatingit. WMExternal:using(St<strong>and</strong>ard)definitions<br />

InputToWindow<br />

Quit<br />

Quit<br />

quitdispatcher<br />

WriteToWindow<br />

Quit<br />

Buffer GetLine Client PutLine Adapter<br />

GetProgram

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!