CS514: Intermediate Course in Operating SystemsApplications of these ideasSlide 3Specific topics we’ll coverWhat should the user “see”?ToolkitsStyle of coding?Toolkit approach: IsisThreadingA tricky model to work with!Examples of tools in toolkitHow toolkits workHow programmers use toolkitsExperience is mixed….Leads to notion of “wrappers”Wrapper examplesExperience with wrappers?Why CORBA f.tol. was a flopFiles and databases?How about “TCP to a group?”How would this work?How to “move” a TCP connectionMigrating a TCP connectionTCP connection stateGeneralizing the ideaFault-tolerant TCP connectionSlide 27What’s new?Choice of multicastTimeline pictureAsynchronous multicastSources of delay?How visible will delay be?Using our solution?Repeat of CORBA f.tol. idea?Determinism worryWould users accept this?Distributed shared memorySome insights that might helpSo what’s the model?To implement this DSM…DSM with a daemonDesign choices?Slide 44Best choice?False sharingWould this work?“Tools” we didn’t discuss todayRecap of today’s lectureCS514: Intermediate Course in Operating SystemsProfessor Ken BirmanVivek Vishnumurthy: TAApplications of these ideasOver the past three weeks we’ve heard about group communicationProcess groupsMembership tracking and reporting “new views”Reliable multicast, ordered in various waysDynamic uniformity (safety), quorum protocolsSo we know how to build group multicast… but what good are these things?Applications of these ideasToday, we’ll review some practical applications of the mechanisms we’ve studiedEach is representative of a class Goal is to illustrate the wide scope of these mechanisms, their power, and the ways you might use them in your own workSpecific topics we’ll coverWrappers and ToolkitsDistributed Program-ming LanguagesWrapping a Simple RPC serverWrapping a Web SiteHardening Other Aspects of the WebUnbreakable Stream ConnectionsReliable Distributed Shared MemoryWhat should the user “see”?Presentation of group communication tools to end users has been a controversial topic for decades!Some schools of thought:Direct interface for creating and using groupsHide in a familiar abstraction like publish-subscribe or Windows event notificationUse inside something else, like a cluster mgt. platform a new programming languageEach approach has pros and consToolkitsMost systems that offer group communication directly have toolkit interfacesUser sees a library with various calls and callbacksThese are organized into “tools”Style of coding?User writes a program in Java, C, C++, C#...The program declares “handlers” for events like new views, arriving messagesThen it joins groups and can send/receive multicastsNormally, it would also use threads to interact with users via a GUI or do other useful thingsToolkit approach: IsisJoin a group, state transfer:Gid = pg_join(“group-name”,PG_INIT, init_func, PG_NEWVIEW, got_newview, XFER_IN, rcv_state, XFER_OUT, snd_state, … 0);Multicast to a group:nr = abcast(gid, REQ, “%s,%d”, “a string”, 1234, ALL, “%f”, &fltvec);Register a callback handler for incoming messagesisis_entry(REQ, got_msg);Receive a multicast:void got_msg(message *mp) {Msg_scan(“%s,%d”, &astring, &anint);Reply(mp, “%f”, 123.45);}A group is created when a join is first issued. In this case the group initializer function is called. The user needs to code that function. Here the “new view” function, also supplied by the user, gets called when the group membership changes If the group already exists, a leader is automatically selected and its XFER_OUT routine is called. It calls xfer_out repeatedly to send state. Each call results in a message delivered to the XFER_IN routine, which extracts the state from the message To send a multicast (here, a totally ordered one), you specify the group identifier from a join or lookup, a request code (an integer), and then the message. This multicast builds a message using a C-style format string. This abcast wants a reply from all members; the replies are floating point numbers and the set of replies is stored in a vector specified by the caller. Abcast tells the caller how many replies it actually got (nr)This is how an application registers a callback handler. In this case the application is saying that messages with the specified request code should be passed to the procedure “got_msg” Here’s got_msg. It gets invoked when a multicast arrived with the matching request code. This particular procedure extracts a string and an integer from the message and sends a reply. Abcast will collect all of those replies into a vector, set the caller’s pointer to point to that vector, and return the number of replies it received (namely, the number of members in the current view)ThreadingA tricky topic in IsisThe user needs threads, e.g. to deal with I/O from the client while also listening for incoming messages, or to accept new requests while waiting for replies to an RPC or multicastBut the user also needs to know that messages and new views are delivered in order, hence concurrent threads pose issuesSolution? Isis acts like a “monitor” with threads, but running them one at a time unless the user explicitly “exits” the monitorA tricky model to work with!We have…Threads, which many people find trickyVirtual synchrony, including choices of orderingA new distributed “abstraction” (groups)Developers will be making lots of choices, some with big performance implications, and this is a negativeExamples of tools in toolkitGroup join, state xferLeader selectionHolding a “token”Checkpointing a groupData replicationLockingPrimary-backupLoad-balancingDistributed snapshotHow toolkits workThey offer a programmer APIMore procedures, e.g.Create_replicated_data(“name”, type)Lock_replica(“name”)Update_replica(“name”, value)V = (type)Read_replica(“name”)Internally, these use groups & multicastPerhaps, asynchronous cbcast as discussed last week…Toolkit builder optimizes extensively, etc…How programmers use toolkitsTwo main stylesReplicating a data structureFor example, “air traffic sector D-5”Consists of all the data associated with that structure… could be quite elaborateProcesses sharing the structure
View Full Document