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

📄 rfc708.txt

📁 RFC 相关的技术文档
💻 TXT
📖 第 1 页 / 共 4 页
字号:
                                   -7-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model					Introducing Processes to One Another2.1  Introductions Within a Homogeneous EnvironmentProvided one remains within a "homogeneous environment" (that is, the domainof a single IPC facility), the introduction of two processes requires littlemore than the formation of an IPC channel between them.  Adding to theProtocol the following system procedures, which manipulate IPC "ports,"enables the run-time environment of the process performing the introductionto negotiate such a channel:	ALOPORT (-> ph,   COMPUTER, PORT)		    INDEX CHARSTR   any	CNNPORT (ph,   computer, port)		 INDEX CHARSTR   any	DCNPORT (ph)		 INDEXThe detailed calling sequences for these procedures are dictated by the IPCfacility that underlies the distributed system.  Those above are thereforeonly representative of what may be required within any particular network,but are only slightly less complicated than those required, for example,within the ARPANET.To create the channel, the introducing process' run-time environmentallocates a PORT in each target process via ALOPORT, and then instructseach process via CNNPORT to connect its port to the other's via the IPCfacility.  The process handle PH returned by ALOPORT serves as a handleboth initially for the allocated port, and then later for the process towhich the attached channel provides access.  To "separate" the two processes,the introducing process' environment need only invoke the DCNPORT procedurein each process, thereby dissolving the channel, releasing the associated ports, and deallocating the process handles.Armed with these three new system procedures, the environment can providethe following new primitives to its applications program:	ITDPROCESS (ph1,  ph2 -> ph12, PH21, ih)		    INDEX INDEX  INDEX INDEX INDEX	SEPPROCESS (ih)		    INDEX                                   -8-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model					  Introducing Process to One AnotherThe first primitive introduces the two processes whose handles PH1 and PH2 are specified.  Each handle may designate either a son, in which case thehandle is one returned by CRTPROCESS; the parent process, for which aspecial handle (for example, 1) must always be defined; or a previouslyintroduced process, in which case the handle is one obtained in a previousinvocation of ITDPROCESS.ITDPROCESS returns handles PH12 and PH21 by which the two processes willknow one another, as well as an "introduction handle IH" that the applicationsprogram can later employ to separate the two processes via SEPPROCESS.  Theapplications program initiating the introduction assumes responsibility forcommunicating to each introduced applications program its handle for the other.2.2  Introductions Within a Heterogeneous EnvironmentWhile their interconnection via an IPC channel is sufficient to introducetwo processes to one another, in a heterogeneous environment the creationof such a channel is impossible.  Suppose, as depicted in Figure 2, that processes P1 and P2 (in computers C1 and C2, respectively) are interconnectedwithin a distributed system by means of a network IPC facility.  Assumefurther that P2 attaches to the system another process P3 in a minicomputerM that although attached to C2 is not formally a part of the network.  Withthis configuration, it is impossible for P2 to introduce processes P1 and P3 to one another by simply establishing an IPC channel between them, sincethey are not within the domain of a single IPC facility.One way of overcoming this problem is to extend the Model to embrace thenotion of a composite or "logical channel" composed of two or more physical (that is, IPC) channels.  A message transmitted by process P1 via the logical channel to Pn (n=3 in the example above) would be relayed over successivephysical channels by the environments of intermediate processes P2 throughPn-1.  Although more expensive than physical channels, since each messagemust traverse at least two physical channels and be handled by all theenvironments along the way, logical channels would nevertheless enable processes that could not otherwise do so to access one another's resources.Since the relaying of messages is a responsibility of the environment, theapplications program need never be aware of it.                                   -9-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model					Introducing Processes to One AnotherAs depicted in Figure 3, a logical channel would consist of table entriesmaintained by the environment of each process P1 through Pn, plus theenvironment to forward messages that arrive with a "routing code" addressingthe local table entry.  Each table entry would contain process handles forthe two adjacent processes, as well as the routing code recognized by each.To communicate a message to its distant neighbor, the source process (say P1) would transmit it via its IPC channel to P2, with a routing codeaddressing the appropriate table entry within P2.  Upon receipt of themessage, P2 would locate its table entry via the routing code, update themessage with the routing code recognized by P3, and forward the messageto P3.  Eventually the message would reach its final destination, Pn.Adding to the Protocol the following system procedures enables theenvironment to construct a logical channel like that described above:	CRTROUTE (mycode, oldcode -> code, ph)                  INDEX   [INDEX]    INDEX INDEX	DELROUTE (yourcode)	          INDEXThe simplest logical channel (n=3) is created by P2, which invokes CRTROUTEin both P1 and P3, specifying in each case the routing code MYCODE it hasassigned to its segment of the logical channel, and receiving in returnthe routing CODES and process handles PHs assigned by the two processes.OLDCODE is not required in this simple case and is therefore EMPTY.More complicated logical channels (n>3) are required when one or bothof the processes to be introduced is already linked, by a logical channel,to the process performing the introduction.  In such cases, a portion ofthe new channel to be constructed must replicate the existing channel, andhence the routing code OLDCODE for the table entry that represents thatchannel within the target process is specified as an additional argumentof the system procedure.  The target process must call CRTROUTE recursivelyin the adjacent process to replicate the rest of the model channel.                                 -10-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model					Introducing Processes to One AnotherThe process Pi that creates a logical channel assumes responsibility forinsuring that it is eventually dismantled.  It deletes the logical channelby invoking DELROUTE in Pi-1 and Pi+1, each of which propagates the calltoward its end of the channel.3.  Controlling Access to Local ResourcesThe process introduction primitive proposed above effectively permitsaccess to a process to be transmitted from one process to another.  Anyprocess P2 that already possesses a handle to a process P1 can obtain a handle for use by a third process P3.  Once P1 and P3 have been introduced,P3 can freely call procedures in P1 (and vice versa).Although a process can, by aborting the ALOPORT system procedure, preventits introduction to another process and so restrict the set of processesthat gain access to it, finer access controls may sometimes be required.A process may, for example, house two separate resources, one of whichis to be made available only to its parent (for example), and the otherto any process to which the parent introduces it.  Before such a strategycan be conveniently implemented, the Model must be extended to permitaccess controls to be independently applied to individual resources withina single process.Although a single procedure can be considered a resource, it is more practical and convenient to conceive of larger, composite resourcesconsisting of a number of related procedures.  A simple data basemanagement module containing procedures for creating, deleting, assigningvalues to, reading, and searching for data objects exemplifies such composite resources.  Although each procedure is useless in isolating, thewhole family of procedures provides a meaningful service.  Such "package"of logically related procedures might thus be the most reasonable objectof the finer access controls to be defined.Access controls can be applied to packages by requiring that a process first "open" and obtain a handle for a remote package before it may callany of the procedures it contains.  When the process attempts to openthe package, its right to do so can be verified and the attempt aborted ifnecessary.  Challenging the open attempt would, of course, be less expensive than challenging every procedure call.  The opening of a package would alsoprovide a convenient time for package-dependent state information to beinitialized.                                 -11-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System					Some Possible Extensions to the Model					Controlling Access to Local ResourcesAdding to the Protocol the following pair of system procedures enables theenvironment to open and close packages within another process.  For efficiency, these procedures manipulate an arbitrary number of packagesin a single transaction.	OPNPACKAGE (packages ->    pkhs)		    LISTofCHARSTRs LISTofINDEXs	CLSPACKAGE (pkhs)		   (as above)The first procedure opens and returns "package handles PKHS" for the specified PACKAGES; the second closes one or more packages and releasesthe handles PKHS previously obtained for them.Besides incorporating these two new system procedures, the Protocol mustfurther require that a package handle accompany the procedure name in everyCALL message (an EMPTY handle perhaps designating a system procedure).  Notethat this requirement has the side effect of making the package the domainwithin which procedure names must be unique.The system procedures described above enable the environment to makeavailable to its applications program, primitives that have callingsequences similar to those of the corresponding system procedures butwhich accept the process handle of the target process as an additionalargument.  Their implementation requires only that the environmentidentify the remote process from its internal tables and invoke OPNPACKAGEor CLSPACKAGE in that process.4.  Standardizing Access to Global VariablesConventional systems often maintain global "variables" that can be accessedby modules throughout the system.  Such variables are typically manipulatedusing primitives of the form:    (1)  Return the current value of V.    (2)  Replace the current contents of V with a new value.These primitives are either provided as language constructs or implementedby specialized procedures.  The former approach encourages uniformtreatment of all variables within the system.Those distributed systems that maintain remotely-accessible variables mustalso select a strategy for implementing the required access primitives.  While such primitives can, of course, be implemented as specialized                                     -12-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model				    Standardizing Access to Global Variablesapplications procedures, adding to the Protocol the following new systemprocedures insures a uniform run-time access mechanism:	RDVARIABLE (pkh,  variable -> value)		    INDEX CHARSTR     any	WRVARIABLE (pkh,  variable, value)		    INDEX CHARSTR   anyThese procedures effectively define variables as named data objects modeledfrom PCP data types, and suggest that they be clustered in packages withrelated procedures.  The system procedures return and specify, respectively,the VALUE of the VARIABLE whose name and package handle PKH are specified.These new procedures enable the environment to make available its applicationsprogram, primitives that have calling sequences similar to those of the corresponding system procedures but which accept the process handle of thetarget process as an additional argument.  These primitives provide a basisupon which a suitably modified compiler can reestablish the compile-timeuniformity that characterizes the manipulation of variables in conventionalprogramming environments.  Their implementation requires only that the localenvironment identify the remote process from its internal tables and invokeRDVARIABLE or WRVARIABLE in that process.Most variables will restrict the range of data types and values that may beassigned to them; some may even be read-only.  But because they are modeledusing PCP data types, their values can, in principle, be arbitrarily complex(for example, a LIST of LISTS) and the programmer may sometimes wish tomanipulate only a single element of the variable (or, if the element is itself a LIST, just one of its elements; and so on, to arbitrary depth).Adding the following argument to their calling sequences extends the systemprocedures proposed above to optionally manipulate a single element of avariable's composite value:	substructure	(LISTofINDEXs)At successive levels of the value's tree structure, the INDEX of the desiredelement is identified; the resulting list of indices identifies theSUBSTRUCTURE whose value is to be returned or replaced.                                     -13-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model				       Routing Parameters Between Procedures5.  Routing Parameters Between ProceduresIn conventional programming systems, the results of procedures are used in avariety of ways, depending upon the context of the calls made upon them.  Aresult may, for example:	(1)  Provide the basis for a branch decision within the calling	     program.	(2)  Become an argument to a subsequent procedure call.	(3)  Be ignored and thus effectively discarded.At run-time, the knowledge of a result's intended use usually lies solelywithin the calling program, which examines the results, passes it to asecond procedure, or ignores it as it chooses.In a distributed system, the transportation of results from callee to caller,carried out by means of one of more inter-process messages, can be anexpensive operation, especially when the results are large.  Data movement can be reduced in Cases 2 and 3 above by extending the Model to permit theintended disposition of each procedure result to be made known in advanceto the callee's environment.  In Case 2, provided both callees residewithin the same process, the result can be held at its source and laterlocally supplied to the next procedure.  In Case 3, the result can be discarded at its source (perhaps not even computed), rather than sent anddiscarded at its destination.5.1  Specifying Parameters IndirectlyVariables offer potential for the eliminating the inefficiencies involved inCase 2 above by providing a place within the callees' process where results generated by one procedure can be held until required by another.  TheProtocol can be extended to permit variables to be used in this way by allowing the caller of any procedure to include optional "argument- and result-list mask" like the following as additional parameters of the CALLmessage:	parameter list mask	[LIST variable, ...)]	      [CHARSTR]A parameter list mask would permit each parameter to be transmitted eitherdirectly, via the parameter list, or indirectly via a VARIABLE within thecallee's process.  Thus each element of the mask specifies how the callee's                                    -14-Network Working Group					      James E. WhiteRequest for Comments:  708	Elements of a Distributed Programming System				       Some Possible Extensions to the Model				       Routing Parameters Between Proceduresenvironment is to obtain or dispose of the corresponding parameter.  To supplythe result of one procedure as an argument to another, the caller need onlythen appropriately set corresponding elements of the result and argumentlist masks in the first and second calls, respectively.  The result listmask should be ignored if the procedure fails, and the error number anddiagnostic message returned directly to the caller.5.2  Providing Scratch Variables for Parameter RoutingAlthough each applications program could provide variables for use as describedabove, a more economical approach is to extend the Model to permit special"scratch variables," maintained by the environment without assistance fromits applications program, to be created and deleted as necessary at run-time.Adding to the Protocol the following pair of system procedures enables thelocal environment to create and delete such variables in a remote process:	CRTVARIABLE (variable, value)		     CHARSTR   any	DELVARIABLE (variable)		     CHARSTRThese procedures create and delete the specified VARIABLE, respectively.CRTVARIABLE also assigns an initial VALUE to the newly-created variable.These new procedures enable the environment to make available to itsapplications program, primitives that have calling sequences similar tothose of the corresponding system procedures but which accept the processhandle of the target process as an additional argument.  Their implementationrequired only that the environment identify the remote process from itsinternal tables and invoke CRTVARIABLE or DELVARIABLE in that process.

⌨️ 快捷键说明

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