⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc708.txt

📁 RFC 相关的技术文档
💻 TXT
📖 第 1 页 / 共 4 页
字号:
5.3  Discarding ResultsThe inefficiencies that result in Case 3 above are conveniently eliminatedby allowing the caller to identify via the result list mask (for example,via a zero-length CHARSTR) that a result will be ignored and therefore neednot be returned to the caller.                                    -15-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model			   Supporting a Richer Spectrum of Control Transfers6.  Supporting a Richer Spectrum of Control TransfersAs currently defined by the Model, a procedure call is a simple two-stagedialog in which the caller first describes the operation it wishes performedand the callee, after performing the operation, reports its outcome.  Although this simple dialog form is sufficient to conveniently implementa large class of distributed systems, more complex forms are sometimes required.  The Model can be extended to admit a variety of more powerful dialog forms, of which the four described below are examples.6.1  Transferring Control Between Caller and CalleeMany conventional programming systems permit caller and callee to exchangecontrol any number of times before the callee returns.  Such "coroutinelinkages" provide a means, for example, by which the callee can obtain help with a problem that it has encountered or deliver the results of onesuboperation and obtain the arguments for the next.Adding to the Protocol the following system procedure, whose invocationrelinquishes control of another, previously initiated procedure, enablesthe environment to effect a coroutine linkage between caller and callee:	TAKEPROCEDURE (tid,  yourtid, parameters) 		       INDEX BOOLEAN  LISTIts arguments include the identifier TID of the affected transaction, anindication YOURTID of from whose name space the identifier was assigned(that is, whether the process relinquishing control is the caller or callee),and PARAMETERS provided by the procedure surrendering control.  By exploiting an existing provision of the Protocol (that is, by declining acknowledgmentof its calls to TAKEPROCEDURE) the invoking environment can effect thecontrol transfer with a single inter-process message.The addition of this new procedure to the Protocol enables the environmentto provide the following new primitive to its applications program:	LINKPROCEDURE (tid,  arguments -> outcome,  results)		       INDEX LIST         [BOOLEAN] LIST                                  -16-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model        		  Supporting a Richer Spectrum of Control TransfersThis primitive assumes that the CALLPROCEDURE primitive is also modified toreturn the pertinent transaction identifier should the callee initiate acoroutine linkage rather than return.  Invocation of LINKPROCEDURE then continues the dialog by supplying ARGUMENTS and returning control to the remoteprocedure, and then awaiting the next transfer of control and the RESULTS thataccompany it.  If the remote procedure then returns, rather than initiatinganother coroutine linkage, the primitive reports its OUTCOME and invalidates the transaction identifier.While this primitive blocks the applications program until the remoterprocedure relinquishes control, a variant that simply initiates the coroutinelinkage and allows the applications program to collect the outcome andresults in a second operation can also be provided.6.2  Signaling the Caller/CalleeA monolog is often more appropriate than the dialog initiated by a coroutinelinkage.  The caller or callee might wish, for example, to report an event it has detected or send large parameters piecemeal to minimize bufferingrequirements.  Since no return parameters are required in such cases, theinitiating procedure need only "signal" its partner, while retaining controlof the call.Adding to the Protocol the following system procedure extends the Model tosupport signals and enables the environment to transmit parameters to orfrom another, previously initiated procedure without relinquishing controlof the call:	SGNLPROCEDURE (tid,  yourtid, parameters)		       INDEX BOOLEAN  LISTLike the TAKEPROCEDURE procedure already described, its arguments includethe identifier TID of the affected transaction, an indication YOURTID offrom whose name space the identifier was assigned, and the PARAMETERSthemselves.This new procedure enables the environment to make available to itsapplications program a primitive that has a calling sequence similar to that of the system procedure but which does not require YOURTID as an argument.Its implementation requires only that the environment identify the remoteprocess via its internal tables and invoke SGNLPROCEDURE in that process.                                    -17-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model                      	   Supporting a Richer Spectrum of Control TransfersBy requesting the acknowledgment of each call to SGNLPROCEDURE and, if necessary, delaying subsequent calls affecting the same transaction untilthe acknowledgment arrives, the invoking environment effects a crude form of flow control and so prevents the remote process' buffers from being overrun.6.3  Soliciting Help from SuperiorsAs in conventional programming systems, remotely callable procedures withina distributed system will sometimes call upon others to carry out portionsof their task.  Each procedure along the "thread of control" resulting fromsuch nested calls is, in a sense, responsible to not only its immediate callerbut also to all those procedures that lie above it along the control thread.To properly discharge its responsibilities, a procedure must sometimescommunicate with these "superiors."Occasionally a procedure reaches a point in its execution beyond which itcannot proceed without external assistance.  It might, for example, requireadditional resources or further direction from the human user upon whosebehalf it is executing.  Before reaching this impasse, the procedure may have invested considerable real and/or processing time that will be lostif it aborts.Adding to the Protocol the following system procedure minimizes suchinefficiencies by enabling the environment to solicit help from a callee'ssuperiors:	HELPPROCEDURE (tid,  number, information -> solution)		       INDEX INDEX   any            anyIts arguments include the identifier TID of the affected transaction (thedirection of the control transfer being implicit in this case), a NUMBERidentifying the problem encountered, and arbitrary supplementaryINFORMATION.  The primitive that this new procedure enables the environment to provideits applications program has an identical calling sequence.  Its implementationrequires only that the environment identify the remote process from itsinternal tables and invoke HELPPROCEDURE in that process.The search for help begins with invocation of HELPPROCEDURE in the caller'senvironment.  If the caller understands the problem (that is, recognizes                                     -18-Network Working Group				                James E. WhiteRequest for Comments:  708	   Elements of a Distributed Programming Model         		     Supporting a Richer Spectrum of Control Transfersits number) and is able to solve it, HELPPROCEDURE will simply return whateverSOLUTION information the caller provides.  Otherwise, HELPPROCEDURE must givethe next superior an opportunity to respond by calling itself recursively in that process.  The search terminates as soon as a superior responds positivelyor when the end of the control thread is reached.  In the latter case, each ofthe nested HELPPROCEDURE procedures returns unsuccessfully to indicate to itscaller that the search failed.6.4  Reporting an Event to SuperiorsA procedure sometimes witnesses or causes an event of which its superiorsshould be made aware (for example, the start or completion of some majorstep in the procedure's execution).  Adding to the Protocol the followingsystem procedure enables the environment to notify a callee's superiors of an arbitrary event:	NOTEPROCEDURE (tid,  number, information)		       INDEX INDEX   anyLike HELPPROCEDURE, its arguments include the identifier TID of thetransaction it affects, a NUMBER identifying the event being reports, andarbitrary supplementary INFORMATION.The primitive that this new procedure enables the environment to provide itsapplications program has an identical calling sequence.  Its implementationrequires only that the environment identify the remote process from itsinternal tables and invoke NOTEPROCEDURE in that process.By requesting acknowledgment of each call to NOTEPROCEDURE and, if necessary,delaying subsequent calls that affect that transaction until the acknowledgmentarrives, the invoking environment effects a crude form of flow control and soprevents the remote process' buffers from being overrun.Notification of the procedure's superiors begins with invocation of NOTEPROCEDURE in the caller's process and works its way recursively up thethread of control until the top is reached.                                     -19-Network Working Group						James E. WhiteRequest for Comments:  708	  Elements of a Distributed Programming System				         Some Possible Extensions to the Model						 Aborting Executing Procedures7.  Aborting Executing ProceduresConventional systems that accept commands from the user sometimes permit himto cancel an executing command issued inadvertently or with erroneousparameters, or one for whose completion he cannot wait.  This ability isparticularly important when the command (for example, one that compiles asource file) has a significant execution time.  In a distributed system, theexecution of such a command may involve the invocation of one or more remoteprocedures.  Its cancellation, therefore, requires the abortion of any outstanding remote procedure calls.Adding to the Protocol the following system procedure provides the basisfor a command cancellation facility by enabling the environment to abortanother, previously invoked procedure:	ABRTPROCEDURE (tid)		       INDEXIts sole argument is the identified TID of the transaction it affects.The primitive that this new procedure enables the environment to make available to the applications program has an identical calling sequence.Its implementation requires only that the local environment identify theremote process from its internal tables and invoke ABRTPROCEDURE in thatprocess.                                 -20-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System								 Conclusions                              CONCLUSIONThe EXPANDED Protocol and Model that result from the extensions proposed inthe present paper are summarized in Appendixes B and C, respectively.  Needless to say, many additional forms and aspects of process interaction,of which Appendix D suggests a few, remain to be explored.  Nevertheless,the primitives already made available by the run-time environment providethe applications programmer with a powerful and coherent set of tools forconstructing distributed systems.                                  -21-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System							     Acknowledgments                           ACKNOWLEDGMENTSMany individuals within both SRI's Augmentation Research Center (ARC) and thelarger ARPANET community have contributed their time and ideas to thedevelopment of the Protocol and Model described in this and its companionpaper.  The contributions of the following individuals are expresslyacknowledged:  Dick Watson, Jon Postel, Charles Irby, Ken Victor, Dave Maynard,Larry Garlick of ARC; and Bob Thomas and Rick Schantz of Bolt, Beranek andNewman, Inc. ARC has been working toward a high-level framework for network-baseddistributed systems for a number of years now [2].  The particular Protocoland Model result from research begun by ARC in July of 1974.  This research included developing the Model; designing and documenting, and implementinga prototype run-time environment for a particular machine [4, 5], specificallya PDP-10 running the Tenex operating system developed by Bolt, Beranek andNewman, Inc. [6].  Three design iterations were carried out during a 12-monthperiod and the resulting specification implemented for Tenex.  The Tenex RTEprovides a superset of the capabilities proposed in this paper.The work reported here was supported by the Advanced Research Project Agencyof the Department of Defense, and by the Rome Air Development Center of theAir Force.                                   -22-Network Working Group						James E. WhiteRequest for Comments:  708	  Elements of a Distributed Programming System			Appendix A:  Transmission Formats for PCP Data Objects                              APPENDIX A              TRANSMISSION FORMATS FOR PCP DATA OBJECTSData objects must be encoded in a standard transmission format before they canbe sent from one process to another via the Protocol.  An effective strategy is to define several formats and select the most appropriate one at run-time,adding to the Protocol a mechanism for format negotiation.  Format negotiationwould be another responsibility of the environment and could thus be madecompletely invisible to the applications program.Suggested below are two transmission formats.  The first is a 36-bit binaryformat for use between 36-bit machines, the second an 8-bit binary, "universal"format for use between dissimilar machines.  Data objects are fully typed in 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -