Electrical computers and digital processing systems: multicomput – Computer-to-computer data routing – Least weight routing
Reexamination Certificate
1997-01-29
2001-05-01
Coulter, Kenneth R. (Department: 2154)
Electrical computers and digital processing systems: multicomput
Computer-to-computer data routing
Least weight routing
C709S241000
Reexamination Certificate
active
06226689
ABSTRACT:
FIELD OF THE INVENTION
The invention relates generally to computer systems, and more particularly a method and mechanism for communication between computer applications.
BACKGROUND OF THE INVENTION
To accomplish multitasking, processes in computer systems running on contemporary operating systems such as Microsoft Corporation's Windows® NT™ or Windows® 95 contain one or more threads of execution. The processor switches control among the threads, which are coded like functions. In one threading architecture known as the apartment model, processes are divided into apartments, with one thread possessing a set of objects per apartment. To invoke an object's methods, an object is called through an interface proxy. The interface proxy switches to the thread of the object's apartment.
An interprocess communication mechanism allows a thread of one process to communicate with and pass data to a thread of another process. Basically, the mechanism allows a client process to send a request to a remote server process. However, if a client thread retains control and blocks pending a reply from the server, the client application will freeze until the reply is received. Since freezing an application is not desirable, a blocking function is provided so that the client can do other work such as reading messages from its message queue and dispatching them. A worker thread in OLE makes the call to the server via a synchronous, blocking local remote procedure call (LRPC), and blocks waiting for the reply. In this manner, while the call is in progress, the client application thread is free to perform other non-conflicting work, such as processing and dispatching messages.
On the server side, an RPC dispatch thread dispatches the call to OLE, which then blocks the dispatch thread, picks up the call and posts a message to the object's thread. The message asks the server application to pick up the request. Some time later, the server application executes the remote call, and returns reply data to the dispatch thread. The dispatch thread then unblocks and returns the call to the server RPC runtime to send the reply back to the client.
While the use of worker and dispatch threads thus provides desirable features, i.e., recursive calls between client and server object threads are allowed and applications are not blocked awaiting replies and receipt of requests and replies, such a mechanism is not very efficient. In particular, each call requires at least two thread-switching operations (i.e., two thread switches, one from the client thread to the worker thread and one back to the client thread) on the client and two thread switches on the server. Each thread switch involves saving one thread's context and loading another thread's context. Moreover, one worker thread is dedicated for each outstanding call made by the client, and a dispatch thread is dedicated for each dispatched call on the server. Multiple calls thus require multiple dedicated threads. Such an approach is thus expensive in terms of the number of threads used, and it is relatively slow.
OBJECTS AND SUMMARY OF THE INVENTION
Accordingly, it is a general objective of the present invention to provide a more efficient interprocess communication method and mechanism.
Another objective is to provide a method and mechanism of the above kind that uses less resources to accomplish interprocess communication.
A related objective is to provide a method and mechanism as characterized above that performs less thread switching operations.
In accomplishing those objects, it is a related objective to provide an interprocess communication method and mechanism that does not dedicate threads based upon the number of calls sent and/or received.
Briefly, the present invention provides a method and mechanism for interprocess communication including a server thread, a server listening thread associated with the server thread, a client thread and a client listening thread associated with the client thread. The client thread sends a request to the server listening thread, and the server listening thread places a message in a message queue associated with the server thread, preferably by calling the Windows post message API. The message includes the request sent to the server listening thread. The message is received at the server thread, preferably via a Windows message loop. The client request is processed and a reply is sent to the client listening thread. The client listening thread notifies the client thread when the reply is received and gives the reply to the client thread.
The processing of the client request by the server thread preferably includes dispatching the message from the server thread to a function in the remote procedure call runtime, and dispatching the request information from the runtime to a remote procedure. On return from the dispatch, the runtime sends the reply to the client.
REFERENCES:
patent: 5463625 (1995-10-01), Yasrebi
patent: 5754752 (1998-05-01), Sheh et al.
patent: 6131126 (2000-10-01), Kougiouris et al.
John Shirley et al.; Microsoft RPC Programming Guide; O'Reilly & Associates, Inc.; pp. 1-20, 56-58, 96-116, May 1995.
Goertzel Mario C.
Mohammed Mazhar N.
Shah Bharat
Coulter Kenneth R.
Michalik & Wylie PLLC
Microsoft Corporation
LandOfFree
Method and mechanism for interprocess communication using... does not yet have a rating. At this time, there are no reviews or comments for this patent.
If you have personal experience with Method and mechanism for interprocess communication using..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method and mechanism for interprocess communication using... will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-2534378