Dispatch mechanism for coordinating application and communication medium state
First Claim
1. At a computer system including one or more processors and system memory, the computer system also including a communication medium, a dispatcher, and an application, the dispatcher and the communication medium supporting a peek lock state coordination pattern to coordinate state transitions between the communication medium and any accessible applications, a method for coordinating state between the communication medium and the application in accordance with the peek lock state coordination pattern, the method comprising:
- an act of the dispatcher interposed between an application and a communication medium sending a message request to the communication medium, the message request requesting a next available message from the communication medium on behalf of the application and which initiates a lock of the next available message by the communication medium;
an act of the dispatcher receiving a view of content of a message comprising the next available message from the communication medium which has been locked by the communication medium following the response to the request from the dispatcher, wherein the dispatcher receiving the content view is indicative of the communication medium having locked the message at the communication medium for access by the dispatcher and such that the message will remain locked at the communication medium to prevent any additional access to the message directly from the communication medium until a dispatcher signal is sent to the communication medium from the dispatcher that indicates that the message is to be unlocked or deleted according to the peek lock state coordination pattern;
an act of the dispatcher offering the content view to the application, even though the message remains locked at the communication medium;
an act of the dispatcher observing an application signal, the application signal indicating whether the application successfully updated an application state for the application based on the content view;
wherein the application does not natively support communication state updates or is unaware of the peek and lock state coordination pattern of the communication medium, such that the application is unable to update the communication medium state; and
an act of the dispatcher sending a dispatcher signal to the communication medium, the dispatcher signal indicating how the communication medium is to update the communication medium state on behalf of the application, the dispatcher signal being based on the observed signal and in accordance with the peek lock state coordination pattern, the dispatcher signal indicating that the next available message is to be deleted when the application signal indicates the application state was successfully updated and the dispatcher signal indicating that the next available message is to be unlocked at the communication medium when the application signal indicates that updating the application state was unsuccessful.
2 Assignments
0 Petitions
Accused Products
Abstract
The present invention extends to methods, systems, and computer program products for coordinating application state and communication medium state. Embodiments of the invention provide mechanisms by which a dispatcher can enable application code to coordinate changes in application state with the consumption of messages from a communication medium. The coordination can be automatic where the dispatcher performs the coordination, or manual, where the coordination is performed more expressly by application code. Embodiments also include mechanisms by which applications targeting an execution (e.g., continuation based) runtime may compose alternative state transitions in the application with a peek lock protocol.
93 Citations
20 Claims
-
1. At a computer system including one or more processors and system memory, the computer system also including a communication medium, a dispatcher, and an application, the dispatcher and the communication medium supporting a peek lock state coordination pattern to coordinate state transitions between the communication medium and any accessible applications, a method for coordinating state between the communication medium and the application in accordance with the peek lock state coordination pattern, the method comprising:
-
an act of the dispatcher interposed between an application and a communication medium sending a message request to the communication medium, the message request requesting a next available message from the communication medium on behalf of the application and which initiates a lock of the next available message by the communication medium; an act of the dispatcher receiving a view of content of a message comprising the next available message from the communication medium which has been locked by the communication medium following the response to the request from the dispatcher, wherein the dispatcher receiving the content view is indicative of the communication medium having locked the message at the communication medium for access by the dispatcher and such that the message will remain locked at the communication medium to prevent any additional access to the message directly from the communication medium until a dispatcher signal is sent to the communication medium from the dispatcher that indicates that the message is to be unlocked or deleted according to the peek lock state coordination pattern; an act of the dispatcher offering the content view to the application, even though the message remains locked at the communication medium; an act of the dispatcher observing an application signal, the application signal indicating whether the application successfully updated an application state for the application based on the content view; wherein the application does not natively support communication state updates or is unaware of the peek and lock state coordination pattern of the communication medium, such that the application is unable to update the communication medium state; and an act of the dispatcher sending a dispatcher signal to the communication medium, the dispatcher signal indicating how the communication medium is to update the communication medium state on behalf of the application, the dispatcher signal being based on the observed signal and in accordance with the peek lock state coordination pattern, the dispatcher signal indicating that the next available message is to be deleted when the application signal indicates the application state was successfully updated and the dispatcher signal indicating that the next available message is to be unlocked at the communication medium when the application signal indicates that updating the application state was unsuccessful. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. At a computer system including one or more processors and system memory, the computer system also including a communication medium, a dispatcher, and an application, the dispatcher, the application, and the communication medium supporting a peek lock state coordination pattern to coordinate state transitions between the communication medium and the applications, a method for coordinating state between the communication medium and the application in accordance with the peek lock state coordination pattern, the method comprising:
-
an act of the dispatcher interposed between an application and a communication medium sending a message request to the communication medium, the message request requesting a next available message from the communication medium on behalf of the application and which initiates a lock of the next available message by the communication medium; an act of the dispatcher receiving a view of content of a message comprising the next available message from the communication medium which has been locked by the communication medium following the response to the request from the dispatcher, wherein the dispatcher receiving the content view is indicative of the communication medium having locked the message at the communication medium for access by the dispatcher in accordance with a peek lock state coordination pattern, and such that the message will remain locked at the communication medium to prevent any additional access to the message directly from the communication medium until an intended update is sent to the communication medium from a communication proxy that indicates that the message is to be unlocked or deleted according to the peek lock state coordination pattern; an act of the dispatcher offering the content view along with the communication proxy to the application, the communication proxy providing sufficient information for the application to communicate with the communication medium in accordance with the peek lock state coordination pattern; wherein the application attempts to update application state for the application based on the content view and thereafter communicates results of the attempted application state update to the communication proxy; and wherein the communication proxy signals the communication medium with the intended update to a communication medium state based on the result of the attempted application state update, the intended update to the communication state being selected from among deleting the message from the communication medium and unlocking the message at the communication medium. - View Dependent Claims (9, 10, 11)
-
-
12. At a computer system including one or more processors and system memory, the computer system also including a communication medium, a dispatcher, and an application, the dispatcher, the application, and the communication medium supporting a state coordination pattern to coordinate state transitions between the communication medium and the applications, the application using a scheduler and shared storage to provide an execution runtime, a method for coordinating state between the communication medium and the application in accordance with the state coordination pattern, the method comprising:
-
an act of the application providing to the scheduler a plurality of executable activities, the plurality of executable activities including a receive activity and one or more state update activities; an act of the scheduler scheduling the receive activity for execution; an act of receiving a content view of a message along with a communication proxy at the receive activity, the content view and communication proxy received from the dispatcher, the message being a message the dispatcher accessed on behalf of the application in accordance with the state coordination pattern, the communication proxy providing sufficient information for the application to communicate with the communication medium in accordance with the state coordination pattern; an act of initializing a shared storage location with a receive context to communicate with the communication medium based on the communication proxy, the shared storage location accessible by other activities of the application to communicate with the communication medium; an act of initializing one or more of the plurality of executable activities configured to update the application state of the application from the content view, the initialized executable activities having access to the shared storage location with the receive context; an act of the scheduler scheduling a first state update activity for execution, the first state update activity included in the plurality of executable activities; an act of attempting to update the application state of the application from the content view through execution of the first state update activity; an act of sending a signal to the receive context, the signal indicating how the communication medium state is to be updated based on the results of attempting to update the application state and in accordance with the state coordination pattern; and an act of the receive context forwarding the signal for delivery to the communication medium. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20)
-
Specification