Communicator e3000 MPE/iX Express 1 Based on Release 7.0
> Chapter 5 Technical ArticlesDCE to RPC 1.2.1 |
||||||||||||||||
|
DeliverablesThe deliverables for RPC 1.2.1 are:
Threads ChangesOne of the major changes during the porting of RPC 1.2.1 is that of the thread functionality. From RPC 1.2.1 onwards threads library components are separated from DCEXL (the DCE executable library). It means that the end-user can write thread related application without linking to DCEXL. The thread library now is delivered and supported by the Process Management Group in CSY as /usr/lib/libpthread.sl. The new library for threads support only POSIX threads standard, also known as Draft10 standard. To use the new thread library, the RPC 1.2.1 component is also moved to POSIX threads standard. RPC 1.2.1 uses POSIX thread implementations. RPCD and RPCCP are not delivered with RPC 1.2.1; they are part of 1.0.2 version only, using the DCE thread APIs.System Environment RequirementThe RPC 1.2.1 software can be used from MPE/iX release 6.0 onwards. RPC 1.2.1 software was released as patches for MPE/iX 6.0 version. To use RPC 1.2.1, the system should be running MPE/iX version 6.0 or later. RPC 1.2.1 comes with some dependent patches. These patches include a loader patch, a libc patch and the threads patch. The patch ID for the current release of RPC 1.2.1 on MPE/iX is FRIKXN7C.New Features in RPC/IDL 1.2.1The following section lists the various new features in the RPC runtime library and IDL of RPC 1.2.1 that are available. Both runtime library and IDL compiler have been implemented to provide the new features in RPC/IDL 1.2.1. Runtime Library:Private client sockets:Previously a common pool of sockets was shared by concurrent RPC requests. Making this concurrency work requires that there be a "helper" thread created to read from all of the open sockets, passing received data onto the call thread for which it is intended. Now with "Private client sockets" there are a couple of sockets (2/3) which will be used only for individual requests (private to the request thread). This reduces the overhead of "helper" thread in case of small applications. However, when we run out of private sockets the sharing of sockets comes into effect.ServiceabilityThis is another new feature, which has been added to RPC runtime. This feature logs messages during the runtime to a specified log file. The level of the messages and the components can be configured using the routing file (/opt/dcelocal/var/svc/routing). This feature will be helpful during analysis of a problem. By default the routing file is picked from "/opt/dcelocal/var/svc/routing". The DCE_SVC_ROUTING_FILE environment variable can be used to name an alternate location for the file. The various switches that can be used are as below:"general" "mutex" "xmit" "recv" "dg_state" "cancel" "orphan" "cn_state" "cn_pkt" "pkt_quotas" "auth" "source" "stats" "mem" "mem_type" "dg_pktlog" "thread_id" "timestamp" "cn_errors" "conv_thread" "pid" "atfork" "inherit" "dg_sockets" "timer" "threads" "server_call" "nsi" "dg_pkt" "libidl".The level of messaging ranges from 0-9, where level 9 is the highest level and gives the maximum details. The file to which the logs should be redirected can also be configured. For example, for the RPC, if we want to generate log files with "general" and "cn_pkt" switch enabled at level 9 with the logs to be written to a file named after the process-id of the process, then the line would be something like rpc:general.9,cn_pkt,9:FILE:/tmp/%ld.log Exception HandlingThe new version RPC 1.2.1 supports the exception-handling feature of RPC. So now the application developer can use the exception handling routines (TRY, CATCH, CATCH-ALL etc.,).DCE-IDL Compiler for RPC1.2.1Out-of-line marshalling (library based marshalling)Out-of-line marshalling causes constructed data types such as unions, pipes or large structures to be marshalled or unmarshalled by auxiliary routines, thus reducing the stub size. The out_of_line attribute directs the IDL compiler to place the marshalling and unmarshalling code in IDL auxiliary stub files, rather than in the direct flow of the stub code. The in_line and out_of_line attributes affect the stub code generated for marshaling and unmarshlling non-scalar parameters (non-scalar types include int, float, char and pointers in C). Normally IDL compiler generates marshalling and unmarshalling code for all parameters in_line. This means that if the same data type is used repeatedly, the identical code will appear in multiple places. If out_of_line is specified, the marshaling and unmarshalling code will be provided as a subroutine, which is called from wherever it is needed.Enhancing IDL data typesIDL support for arrays in previous version was limited to:
[min_is(a)] long g1[*..10]; /* g1[-10..10] */ [min_is(a)] long g2[*..10][4]; /* g2[-10..10][0..3] */ [min_is(a,b)] long g3[*..10][*..20]; /* g3[-10..10][-20..20] */ [min_is(,b)] long g4[2][*..20]; /* g4[0..1][-20..20] */ [min_is(a,,c)] long g5[*..7][2..9][*..8]; /* g5[-10..7][2..9][-30..8] */ [min_is(a,b,)] long g6[*..10][*..20][3..8]; /* g6[-10..10][-20..20][3..8] */ [max_is(,,e),min_is(a)] long g7[*..1][2..9][3..*]; /* g7[-10..1][2..9][3..25] */ [min_is(a,,c),max_is(,d,e)] long g8[*..1][2..*][*..*]; /* g8[-10..1][2..15][-30..25] */ Support for IDL encoding Services:This extension to the IDL stub compiler will enable instances of one or more data types to be encoded into and decoded from a byte stream format suitable for persistent storage without invoking RPC Runtime. The encode and decode attributes are used in conjunction with IDL Encoding service routines (idl_es*) to enable RPC applications to encode datatypes in input parameters into a byte stream and decode datatypes in output parameters from a byte stream without invoking the RPC runtime. Encoding and decoding operations are analogous to marshaling and unmarshalling, except that the data is stored locally and is not transmitted over the network.Support for User defined ExceptionsThis extension to the IDL compiler will allow specification of a set of user-defined exceptions that may be generated by the server implementation of the interface. If an exception occurs during the execution of the server, it terminates the operation and the exception is propagated from server to client.Support for Customized Binding handlesThis enhancement allows the application developer to add some information that the application wants to pass between the client and server. This can be used when application-specific data is appropriate to use for finding a server when the data is also needed as a procedure parameter.ReferencesFor details on the features of IDL refer to the below mentioned RFC:
|