主权项 |
1. In a computing environment, a method of managing a concurrency based system, the method comprising:
determining a maximum number of concurrent operations for a concurrency based management system; accessing an operation queue, the operation queue storing or having therein zero or more asynchronous operation request messages; maintaining a count for a number of scheduled operations; while the queue is not empty and while the count for the number of scheduled operations is less than the maximum number, scheduling asynchronous operations from the queue and incrementing the count for the number of scheduled operations, wherein scheduling asynchronous operations comprises, for each scheduled operation, instantiating a future object representing the each scheduled operation, the future object supporting completion states including ran to completion, faulted, and cancelled; and upon completion of a scheduled operation,
notifying continuation operations which have been registered to be notified of the completion of the scheduled operation with the state of the future object representing the scheduled operation,disposing the future object representing the scheduled operation, anddecrementing the count for the number of scheduled operations. |