Method, system, and computer product for controlling input message priority
View Patent ↗An operating system allows assignment of an input message priority to a particular socket. This priority is used by the operating system to determine what socket's inbound packets get discarded when the server resources are constrained. Sockets of a lower priority than another will have its inbound packets discarded before higher priority sockets. This allows an application to give selected sockets higher inbound message priority over other sockets.
1. A method of controlling input message priority, comprising:
dynamically assigning a priority to a plurality of incoming messages, the assignment being performed by a receiving system that is receiving the incoming messages;
placing the incoming messages in a storage, the storage being available for use by at least one application in the receiving system;
managing the storage at the receiving system by using the assigned priority to identify a portion of the incoming messages in the storage to discard, when needed to make space available;
wherein the priority has a type selected from a group including socket-level, application-level, and default-level; and
wherein socket-level priority takes precedence over application-level priority and application-level priority takes precedence over default-level priority;
determining whether there is space in the storage for one of the incoming messages;
if there is no space in the storage, letting p=a lowest packet priority and let N=a free block threshold;
determining whether the one incoming message priority is lower than p;
if the one incoming message priority is higher than p, determining whether a number of queued packets at priority p is greater than or equal to N;
if a number of queued packets at priority p is greater than or equal to N, then discarding N packets at priority p and queuing the one incoming message normally;
if the number of queued packets at priority p is less than N, then discarding a predetermined number i of packets at priority p; and
letting N=N−i, p=the next lowest priority, and then determining whether the incoming message priority is lower than p.
2. The method of claim 1 , wherein the storage is a queue associated with a Transmission Control Protocol/Internet Protocol (TCP/IP) stack in the receiving system.