Not Applicable.
Not Applicable. INCORPORATION BY REFERENCE OF MATERIAL SUBMITTED ON A COMPACT DISC
Not Applicable.
The invention disclosed broadly relates to the field of communications and more particularly relates to the field of communication of data structures between computer nodes.
Communicating processes in software systems require sharing of data and often communicate by exchanging messages containing the necessary data. Historically, message-passing processes spend a significant computational effort marshalling the data: gathering the relevant parts of the data from the memory of the sending program, and assembling them into a canonical serial format (or wire protocol). This serialized data is then transmitted to the receiver process—for example, by writing it to a file or by streaming it over a network—which then unmarshals the message into the desired format.
Some programming languages provide facilities to automate this process, which is often referred to as serialization. Typically, a serialization library uses class meta-data, which is provided by the programming language's runtime-system. This meta-data describes the structure of the types and data structures in the system, and enables the serialization support to automatically marshal and unmarshal program data structures. The whole process may be completely transparent to the user, encapsulated by a single procedure call—for example, send(x) in the sender, y:=recv( ) in the receiver. Although this automatic facility reduces programmer effort, it may introduce significant computational work if the serialized data structure is large.
As an optimization, some object-oriented programming languages allow the user to specify that object-graph edges originating at certain object fields are not to be traversed during marshalling. In object oriented programming languages, a data structure will often be represented as a graph of objects, wherein each object in the data structure contains fields that hold pointers or references to other objects in the data structure. For some data structures, this annotation can significantly reduce the size of the serialized format. Reachable fields so marked are not considered part of the persistent state of the object, but may be used to hold derived or cached values, for example.
For example, the Java standard library contains a serialization mechanism in the classes java.util.ObjectOutputStream and java.util.ObjectInputStream. The programmer may label fields of Java classes transient to prevent them from being serialized. One major limitation of this approach is that Java only allows a pointer to be declared transient of not depending on the declared field. The contents of a particular field will either always be transient and thus not communicated, or will always be considered persistent and communicated. However, there are situations where better performance could be obtained if one could defer the decision of what data to communicate until run-time, when more information is available.
Therefore, there is a need to overcome problems with the prior art as discussed above, and more particularly a need to make the process of communicating data structures more efficient.
Briefly, according to an embodiment of the invention, a method for regulating communication of information in a data structure between components of a computer program is disclosed. The method includes reading a computer program and automatically identifying fields of a data structure that must be transmitted from a first component of the computer program to a second component of the computer program. The method further includes generating a routine that indicates the fields of the data structure that were identified. The method further includes requiring the first component to execute the routine when sending the data structure to the second component, such that the first component only marshals the fields of the data structure that are indicated by the routine.
In another embodiment of the present invention, an information processing system for regulating communication of information in a data structure between components of a computer program is disclosed. The information processing system includes a reader for reading a computer program. The information processing system further includes a processor configured for automatically identifying fields of a data structure that must be transmitted from a first component of the computer program to a second component of the computer program, generating a routine that indicates the fields of the data structure that were identified, and requiring the first component to execute the routine when sending the data structure to the second component, such that the first component only marshals the fields of the data structure that are indicated by the routine.
In yet another embodiment of the present invention, a computer readable medium including computer instructions for regulating communication of information in a data structure between components of a computer program is disclosed. The computer instructions include instructions for reading a computer program and automatically identifying fields of a data structure that must be transmitted from a first component of the computer program to a second component of the computer program. The computer instructions further include instructions for generating a routine that indicates the fields of the data structure that were identified and requiring the first component to execute the routine when sending the data structure to the second component, such that the first component only marshals the fields of the data structure that are indicated by the routine.
The subject matter, which is regarded as the invention, is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The foregoing and other features and also the advantages of the invention will be apparent from the following detailed description taken in conjunction with the accompanying drawings. Additionally, the left-most digit of a reference number identifies the drawing in which the reference number first appears.
The present invention provides a method, computer readable medium and information processing system for regulating communication of information in a data structure, such as an object, between applications or among components of a computer program. The present invention automatically analyzes a set of communicating applications, computer programs or components thereof and identifies portions of data structures that can be omitted from individual messages, without impacting computer program semantics. The present invention can be used either to provide recommendations via a tool on how to specify data structure annotations, or to automatically set annotations without computer programmer intervention.
In one embodiment of the present invention, the method of the present invention results in a decision procedure embodied in a function, method or computer program routine that is consulted when a send action is initiated. When a first application, computer program or components thereof requests to send information in an object to a second application, the decision procedure is executed. The decision procedure identifies those portions of the object that must be transmitted. Subsequently, the portions of the object that were identified are marshalled and transmitted to the second application.
In an embodiment where nodes 102 and 104 are applications or components of applications, the nodes can be implemented as hardware, software or any combination of the two. The applications or components of applications can be located in a distributed fashion in both nodes 102 and 104, as well as other nodes. In this embodiment, the applications or components of applications of nodes 102 and 104 operate in a distributed computing paradigm.
In an embodiment of the present invention, the computer systems of the nodes 102 and 104 are one or more Personal Computers (PCs) (e.g., IBM or compatible PC workstations running the Microsoft Windows operating system, Macintosh computers running the Mac OS operating system, or equivalent), Personal Digital Assistants (PDAs), hand held computers, palm top computers, smart phones, game consoles or any other information processing devices. In another embodiment, the computer systems of the nodes 102 and 104 are a server system (e.g., SUN Ultra workstations running the SunOS operating system or IBM RS/6000 workstations and servers running the AIX operating system). The computer systems of the nodes 102 and 104 are described in greater detail below with reference to
In an embodiment of the present invention, the network 106 is a circuit switched network, such as the Public Service Telephone Network (PSTN). In another embodiment, the network 106 is a packet switched network. The packet switched network is a wide area network (WAN), such as the global Internet, a private WAN, a local area network (LAN), a telecommunications network or any combination of the above-mentioned networks. In yet another embodiment, the network 106 is a wired network, a wireless network, a broadcast network or a point-to-point network.
It should be noted that although nodes 102 and 104 are shown as separate entities in
In step 206, the decision procedure executes. In step 208, the decision procedure identifies portions of the data structure 108 for marshalling. In step 210, based on the portions of the data structure 108 that were identified in step 208 above, the serialization process marshals the portions of the data structure 108 that were identified. In step 212, the marshaled data is transmitted to the second node 104. In step 214, the control flow of
In step 306, the marshaled data is received by the second node 104. In step 308, the decision procedure executes. In step 310, the decision procedure identifies portions of the data structure 108 for unmarshalling. In step 312, based on the portions of the data structure 108 that were identified in step 310 above, the de-serialization process unmarshals the portions of the data structure 108 that were identified. In step 314, the control flow of
Subsequently, the serializer 412 marshals the fields 406 and 410 and produces the serialized data 414, which is then transmitted to the node 104 via the network 106.
The present invention is directed towards a method for identifying portions of a data structure, such as an object, that need not be transmitted between applications or among components of a computer program. One embodiment of the present invention is directed towards a method for generating a decision procedure, as embodied in 416 and 516, for regulating communication of information in a data structure, such as an object, between applications or among components of a computer program. Another embodiment of the present invention is directed towards a method for indicating to a computer programmer those portions of a data structure that need not be transmitted between applications or among components of a computer program.
In step 604, a computer program is read. This entails the reading of the source code of a computer program. Alternatively, the object code or executable code of a computer program can be read. In step 606, a send-receive graph is generated for the computer program that was read. A send-receive graph is a summary of the communication pattern of the computer program. The send-receive graph can be either specified by a human or generated automatically.
In a simple application, the sending computer program component might contain only one call to a send(x) function or method and the receiving computer program component only one call to a recv( ) function. The information-flow relationship between points in different computer program components can be characterized by a send-receive graph. In this simple case, the send-receive graph consists of a pair of points S, R, wherein S represents the statement send(x) in the sender, and R represents the statement recv( ) in the receiver, resulting in a single directed edge (S,R) connecting the sender and receiver. The send-receive graph for a more complex application may have more sender and/or receiver nodes and more edges between them.
In step 608, given a send-receive graph G for a send node/receive node pair, such as nodes 102 and node 104, the present invention generates an abstraction that summarizes the shape of a data structure at each send operation in the send node 102 computer program. In this context, shape is defined to be any abstract representation of a data structure that represents properties of the data structure. The abstraction may record information such as types of objects in the data structure, allocation sites between objects in the data structure, or relationships between objects in the data structure. The invention will generate such an abstraction using any of a number of program analysis techniques variously known in the literature as pointer analysis, abstract interpretation, or shape analysis.
In step 610, for each such send operation, the corresponding receive operation(s) in the receive node 104 is/are identified. At each such receive operation, it is assumed that the shape of the data structure received matches the shape described by the summary at the corresponding send operation in the send node 102.
In step 612, the shape information summarized in the receive node 104 during step 610 is incorporated into the program analysis method employed to generate shape abstractions in the receiver program. That is, the method of program analysis (pointer analysis, abstract interpretation, or shape analysis) is modified to assume that the data structure received at 104 conforms to the indicated shape. Then, in step 612, the process re-computes the program analysis incorporating this assumption. Using this new assumption, the program analysis may or may not compute a new value of the shape abstraction for some data structure at some program point in the receiver program. In step 614, it is determined whether this is the case. If the result of determination of step 614 is affirmative, then control flows to step 608, which is repeated. Otherwise, no such shape abstraction has changed and control flows to step 616.
In step 616, for each data structure modeled at a receive operation, it is computed which portion(s) of that data structure are required for correct computer program execution. In step 618, any portions of any data structures which step 616 fails to identify as required, are not required, and thus need not be included in the corresponding message, i.e., need not be marshaled for sending. In step 620, the control flow of
Below is an example showing the process of
Starting with step 604, the source code above is read. In step 606, a send-receive graph is generated for this example. The notation X@y=>W@z means that program X at line y sends a message to program W which is received at line z. In our example, the following nodes and edges are defined:
A@3=>B@6
B@8=>A@4
In step 608, an abstraction is computer for each data structure at every send point in each program. In this example, step 608 computes shape abstractions using a standard flow-sensitive alias analysis technique, which will be well-understood by those skilled in the art of program analysis. It is assumed that data structures received are empty. The following result is computed for A:
—at line 3, c.x=“Hello” and c.y=null
And the following result is computed for B:
—at line 8:q.x=null and q.y=“Goodbye”
In step 610, the above information is incorporated at receive points, resulting in the following:
Since A@3−>B@6, at line 6, q.x=“Hello” and q.y=null
Since B@8−>A@4, at line 4, r.x=null and q.y=“Goodbye”
In step 612, the above information is incorporated and in step 614, control flows back to step 608, which is repeated. Using the updated information, step 608 produces:
—at line 3, c.x=“Hello” and c.y=null
—at line 8: q.x=“Hello” and q.y=“Goodbye”
Repeating step 610 with the new solution, the following is computed:
Since A@3−>B@6, at line 6, q.x=“Hello” and q.y=null
Since B@8−>A@4, at line 4, r.x=“Hello” and q.y “Goodbye”
In step 612, the above information is incorporated and in step 614, the new solution, shows that:
—at line 3, c.x=“Hello” and c.y=null
—at line 8: q.x=“Hello” and q.y=“Goodbye”
At this point, the solution has reached a fixed point and the system has reached the same solution in two consecutive executions. Thus, the analysis proceeds to step 616. Attention is brought to the recv( ) operation at line 4. Using dataflow analysis, step 616 computes that downstream from line 4, program A will use field r.x (at line 5) but not field r.y. Step 618 concludes that messages that are received at line 4 need not contain they field of the Cell data structure. Since B@8=>A@4, the system optimizes execution by excluding the q.y data when marshalling the message sent at line 8.
As explained above, the present invention is directed towards a method for identifying portions of a data structure that need not be transmitted between applications or among components of a computer program. One embodiment of the conclusion of step 618 above (as to which portions need not be marshaled) can be embodied in a decision procedure, as embodied in 416 and 516, that is executed before data is marshaled between applications or among components of a computer program. Another embodiment of the conclusion of step 618 above is an interface that indicates to a computer programmer those portions of a data structure that need not be marshaled. The computer programmer can utilize this information to decide whether to modify the source code according to the recommendations of a decision procedure.
The present invention can be realized in hardware, software, or a combination of hardware and software. A system according to a preferred embodiment of the present invention can be realized in a centralized fashion in one computer system, or in a distributed fashion where different elements are spread across several interconnected computer systems. Any kind of computer system—or other apparatus adapted for carrying out the methods described herein—is suited. A typical combination of hardware and software could be a general-purpose computer system with a computer program that, when being loaded and executed, controls the computer system such that it carries out the methods described herein.
An embodiment of the present invention can also be embedded in a computer program product, which comprises all the features enabling the implementation of the methods described herein, and which—when loaded in a computer system—is able to carry out these methods. Computer program means or computer program in the present context mean any expression, in any language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: a) conversion to another language, code or, notation; and b) reproduction in a different material form.
A computer system may include, inter alia, one or more computers and at least a computer readable medium, allowing a computer system, to read data, instructions, messages or message packets, and other computer readable information from the computer readable medium. The computer readable medium may include non-volatile memory, such as ROM, Flash memory, Disk drive memory, CD-ROM, and other permanent storage. Additionally, a computer readable medium may include, for example, volatile storage such as RAM, buffers, cache memory, and network circuits. Furthermore, the computer readable medium may comprise computer readable information in a transitory state medium such as a network link and/or a network interface, including a wired network or a wireless network, that allow a computer system to read such computer readable information.
The computer system can include a display interface 708 that forwards graphics, text, and other data from the communication infrastructure 702 (or from a frame buffer not shown) for display on the display unit 710. The computer system also includes a main memory 706, preferably random access memory (RAM), and may also include a secondary memory 712. The secondary memory 712 may include, for example, a hard disk drive 714 and/or a removable storage drive 716, representing a floppy disk drive, a magnetic tape drive, an optical disk drive, etc. The removable storage drive 716 reads from and/or writes to a removable storage unit 718 in a manner well known to those having ordinary skill in the art. Removable storage unit 718, represents a floppy disk, a compact disc, magnetic tape, optical disk, etc. which is read by and written to by removable storage drive 716. As will be appreciated, the removable storage unit 718 includes a computer readable medium having stored therein computer software and/or data.
In alternative embodiments, the secondary memory 712 may include other similar means for allowing computer programs or other instructions to be loaded into the computer system. Such means may include, for example, a removable storage unit 722 and an interface 720. Examples of such may include a program cartridge and cartridge interface (such as that found in video game devices), a removable memory chip (such as an EPROM, or PROM) and associated socket, and other removable storage units 722 and interfaces 720 which allow software and data to be transferred from the removable storage unit 722 to the computer system.
The computer system may also include a communications interface 724. Communications interface 724 allows software and data to be transferred between the computer system and external devices. Examples of communications interface 724 may include a modem, a network interface (such as an Ethernet card), a communications port, a PCMCIA slot and card, etc. Software and data transferred via communications interface 724 are in the form of signals which may be, for example, electronic, electromagnetic, optical, or other signals capable of being received by communications interface 724. These signals are provided to communications interface 724 via a communications path (i.e., channel) 726. This channel 726 carries signals and may be implemented using wire or cable, fiber optics, a phone line, a cellular phone link, an RF link, and/or other communications channels.
In this document, the terms “computer program medium,” “computer usable medium,” and “computer readable medium” are used to generally refer to media such as main memory 706 and secondary memory 712, removable storage drive 716, a hard disk installed in hard disk drive 714, and signals. These computer program products are means for providing software to the computer system. The computer readable medium allows the computer system to read data, instructions, messages or message packets, and other computer readable information from the computer readable medium.
Computer programs (also called computer control logic) are stored in main memory 706 and/or secondary memory 712. Computer programs may also be received via communications interface 724. Such computer programs, when executed, enable the computer system to perform the features of the present invention as discussed herein. In particular, the computer programs, when executed, enable the processor 704 to perform the features of the computer system. Accordingly, such computer programs represent controllers of the computer system.
What has been shown and discussed is a highly-simplified depiction of a programmable computer apparatus. Those skilled in the art will appreciate that other low-level components and connections are required in any practical application of a computer apparatus.
Therefore, while there has been described what is presently considered to be the preferred embodiment, it will be understood by those skilled in the art that other modifications can be made within the spirit of the invention.