Electrical computers and digital processing systems: multicomput – Computer-to-computer data routing – Least weight routing
Reexamination Certificate
1997-01-29
2001-01-16
Oberley, Alvin E. (Department: 2755)
Electrical computers and digital processing systems: multicomput
Computer-to-computer data routing
Least weight routing
Reexamination Certificate
active
06175879
ABSTRACT:
FIELD OF THE INVENTION
The invention relates generally to computer networks, and more particularly to an improved method and mechanism for handling network connections with threads.
BACKGROUND OF THE INVENTION
A receive-any thread is a thread of execution in a server process that handles both requests for new connections and incoming remote procedure call (RPC) requests on (one or more) existing connections, if any. The receive-any thread responds to a new connection request by posting an accept, and to an RPC data request by posting a receive. Receive-any threads accomplish this dual-functionality using a Windows® Sockets API (WinSock) call such as selects( ) to block, listening for new connection requests and activity on existing connections. Other environments use similar APIs. Since RPC servers typically listen on more than one protocol (e.g., TCP, SPX or ADSP) at any given time, one receive-any thread is provided to deal with each protocol.
However, because receive-any threads multiplex between requests for new connections and receiving RPC data, perform parameter validation and do extra data copying (buffering), they are relatively slow. More particularly, when receiving data via a receive-any thread, the cost of the select and the extra copying cost of transferring data from the transport buffers to the RPC runtime add substantial runtime overhead. As a result, another type of thread known as a receive-direct thread may be used for an existing data connection.
A receive-direct thread is a dedicated thread which receives RPC requests on a specific connection and dispatches those requests. A receive-direct thread pre-posts a receive on the connection to avoid the data copying and the overhead associated with select( ), i.e., using the WinSock recv( ) API, a receive-direct thread receives data into application buffers as the data arrives. Receive-direct threads thus have less runtime overhead and provide better performance when handling data than do receive-any threads. Indeed, in certain instances, the use of a receive-direct thread provides at least a twenty percent performance improvement over a receive-any thread.
However, each receive-direct thread has costs associated therewith including an increased memory size and footprint. With the above scheme of making existing data connections receive-direct connections, many receive-direct threads, up to some predetermined quota, may be allocated in memory. If a connection is idle or mostly idle, the receive-direct thread associated therewith is also idle and system resources are wasted. Moreover, a receive-direct thread may not be available for a newer, highly active connection because other for a newer, highly active connections because other connections, including idle connections, have used up the quota of receive-direct threads. The highly active connection instead has to remain receive-any, and thus suffers from the reduced performance associated with receive-any data handling.
OBJECTS AND SUMMARY OF THE INVENTION
Accordingly, it is a general object of the present invention to provide a method and mechanism for more efficiently using receive-any and receive-direct threads for handling connections.
Another object is to provide a method and mechanism of the above kind that adjusts thread usage for idle or active connections.
A related object is to provide a method and mechanism as characterized above that migrates connections between receive-any and receive-direct based upon connection activity.
In accomplishing those objects, it is another object of the invention to provide a common receive-any thread that listens on multiple protocols.
Briefly, the present invention provides a method and mechanism for handling a connection in a computer system between a client socket and a data socket of a server. The server includes a receive-direct thread associated with the data socket for handling communication on the connection, and a receive-any thread with a socket mask associated therewith. When the connection has no activity for a period of time, information referencing the data socket associated with the receive-direct thread is moved to the socket mask associated with the receive-any thread, whereby the (idle) connection becomes a receive-any connection. A receive-any connection that becomes active is migrated to a receive-direct thread, when one is available.
REFERENCES:
patent: 5247676 (1993-09-01), Ozur et al.
patent: 5307490 (1994-04-01), Davidson et al.
patent: 5430876 (1995-07-01), Schreiber et al.
patent: 5745778 (1998-04-01), Alfieri
patent: 5774668 (1998-06-01), Choquier et al.
patent: 5822525 (1998-10-01), Tafoya et al.
Goertzel Mario C.
Mohammed Mazhar N.
Shah Bharat
Courtenay III St. John
Michalik & Wylie PLLC
Microsoft Corporation
Oberley Alvin E.
LandOfFree
Method and system for migrating connections between... 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 system for migrating connections between..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method and system for migrating connections between... will most certainly appreciate the feedback.
Profile ID: LFUS-PAI-O-2554347