Quantitative Analysis
Parallel Processing
Numerical Analysis
C++ Multithreading
Python for Excel
Python Utilities
Services
Author

I. Installation.
II. Threading primitives.
III. NonBlockingQueue.
IV. ThreadPool.
V. ThreadMaster.
VI. OTS Scheduler.
1. Scheduler implementation.
A. Node class.
a. Initial processing of an update event.
b. Processing of out-of-date Nodes.
B. Exception handling policy.
2. Customization of Scheduler. Interfaces IOrigin and IProxy.
3. Acceptance test for the Scheduler.
VII. Bibliography
Downloads. Index. Contents.

Processing of out-of-date Nodes.


he Nodes are removed from theWaitingQueue by concurrent working threads. If theNeedToUpdate field of the Node is "true" then this Node was already visited by the tree walk (described here). No significant operation is performed in such case. If theNeedToUpdate is "false" then such Node does not have any Sources (Parents) in dependency tree that were removed from theWaitingQueue. In such case, the procedure walks through dependency tree (Listeners, depth-first) of the Node. It goes only deep enough to set theNeedToUpdate to "true". When it encounters theNeedToUpdate that is already "true" then it reverses the direction of walk, it does not go deeper. On every visit the procedure increments theNumberOfSourcesOutOfDate by 1 and removes the visited Node from theUpdateQueue. When such process is finished, theWaitingQueue is empty, theUpdateQueue contains the out-of-date Nodes that do not have out-of-date Parents (Sources) and every Node in the tree knows exactly how many of its immediate parents are out-of-date.

At that point the procedure starts to remove the Nodes from theUpdateQueue by concurrent working threads. Every such Node updates (operation on theProxy field), sends failure or success notification (operation on theOrigin field) and decrements theNumberOfSourcesOutOfDate for all Children (Listeners). Those Listeners whose theNumberOfSourcesOutOfDate becomes zero are placed into theUpdateQueue. When this process is finished, all the out-of-date Nodes were brought up-to-date in optimal order.





Downloads. Index. Contents.


















Copyright 2007