CompuServe Messages

CPU Sharing question.

    22-Aug-90 11:50:57
Fm: Christopher R. Hertel 76424,213
To: Don Curtis/SYSOP 76703,4321
Yes, you are correct. My indexing system is the good old AVL tree. As many searches as you like can be done at the same time, and you can even add index entries (one at a time) while searching is going on. (Because the addition of the index entry always occurs at a leaf node, and the final link up is a single instruction.) Deletions are more complex, because you may have to move subtrees around. Restructuring is the worst, because you have to climb back up the tree and rebalance at each node until you create a properly balanced tree (which could involve adjusting things up the entire height of the tree). So, the situation is this: I've got to queue up the searches, adds, deletes, and restructures for each database in memory. When a search is running, I can continue to allow other searches on the same database to start. When I get a delete or rebuild in the queue, I have to let the searches finish before I can start the delete or rebuild. A single add may be run while searches are still going. Once that add is finished, another add may start. So: How to I put the tasks that are waiting (while their delete is in the queue, for example) into a proper wait state, and how do I wake them up. I guess that this is an EXEC question. I want to use a mechanism that is private and that does not have any serious limits on the number of tasks that it is juggling. Low overhead would be nice too.