source: trunk/third/ORBit/docs/idl-compiler-2.txt @ 15271

Revision 15271, 3.5 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15270, which included commits to RCS files with non-trunk default branches.
Line 
1                                Tasks
2
3Headers:
4        Typedefs
5
6        Prototypes (per-interface, per-operation, per-type).
7
8Common:
9        Allocation & freeing (per-type).
10
11Stubs:
12        Stubs (per-operation)
13                Short-circuiting
14                Setup
15                Marshalling
16                Exception & location_forward handling
17                Sending
18                Receiving
19                Freeing/allocating values
20                Demarshalling
21                Return
22
23Skeletons:
24        Skeletons (per-operation)
25                Allocating values
26                Demarshalling
27                Call
28                Setup for reply
29                Exception handling
30                Marshalling
31                Sending
32                Freeing values
33                Return
34
35
36                                (de)marshalling tasks
37
38All (de)marshalling tasks can be represented using the following type of data
39structure (PIDL):
40        union MarshalNode switch(NodeType) {
41                case VALUE: {
42                        string variable_name;
43                        short value_length;
44                }
45                case CONSTANT: {
46                        long value;
47                }
48                case ARRAY: {
49                        string pointer_name;
50                        MarshalNode num_entries;
51                }
52
53                IDL_tree corresponding_idl_node;
54        };
55
56Need to make a data structure that better represents "what we need to do"
57rather than "what we are working on". Something that can say "(de)marshal
58value|increment a pointer|loop back"... Optimization on this will be somewhat
59easier.
60
61/* In skels: If not sending a reply back, don't get a send_buffer
62unless we need to raise an exception. */ Incorrect - for any given op
63you either always need to send something back, or never.
64
65Pieces of a stub (prerequisite steps are in []'s):
66Pre:    If ev == NULL, bomb out.
671.      Sanity check params (and handle exceptions).
682.      Check for & handle local call. [1]
693.      Get connection (and handle exceptions). [1]
704.      Get send buffer (is it possible for any exceptions to be raised here?).
715.      Marshal params. [1, 4]
726.      Write send buffer (and handle exceptions). [5]
737.      Unuse send buffer. [6]
748.      Receive reply (and handle exceptions). [6]
759.      Do any necessary location forwarding & exception handling. [8]
7610.     Allocate any needed memory for retvals.
7711.     Demarshal retvals (with versions for endianness) (and handle exceptions). [9, 10]
7812.     Unuse receive buffer. [11]
7913.     Return. [11]
80
81Could swap 2 & 3, or 7 & 8. 11 & 12 can't be swapped due to 12's flow
82changing effects :-). Don't want to swap 2 & 3 - don't do remote stuff
83it is local. 7 & 8 just maybe could be swapped, but not sure it makes much sense.
84
85Pieces of a skeleton (prerequisite steps are in []'s):
860.      Allocate any needed memory for params.
871.      Demarshal (with versions for endianness) (and handle exceptions). [0]
882.      Call impl. [1]
893.      Get send reply buffer (can this raise any exceptions?). [2]
904.      If no exceptions raised:
91                Marshal retvals. [3]
92        else marshal exceptions. [3]
935.      Write send buffer (and handle exceptions). [4]
946.      Unuse send buffer.
95
96No pipelining possible in skeletons.
97
98Actually, should integrate memory allocation with demarshalling - it'd
99be cleaner to do (if not a little more space wasting when it comes to
100dual versions for endianness).
101
102You can marshal multi-element pieces of structs.
103
104In skels: If not sending a reply back, don't get a send_buffer unless
105we need to raise an exception.
106
107When demarshalling, maintain a local 'cur' pointer rather than modifying
108the one inside the receive buffer. Will need to update the one inside the
109rbuf if we call a complex demarshaller thing.
110
111Reduce amount of code in stubs by having send_buffer_use() return the
112request_id as part of its operation, instead of having to get a new
113request_id as part of the stub.
114
115Use function pointers instead of a series of if's to speed things up.
116
117Pre-computation of alignment for stuff that can be pre-computed (like
118operation name vecs, etc.)
119
120For multithreading speedups, don't lock the connection until we actually need to send.
Note: See TracBrowser for help on using the repository browser.