Monday, November 26, 2007

threading model for the COW DB

With branches done and working, the threading model has resurfaced as an issue. At the moment, except for the cache shared by all the databases, nothing is thread safe. But you can have a different thread for each database. That's a bit primitive and needs changing.

Here's what I'm planning:
For each database, there can be no more than a single writer. And for each branch, either a single writer or multiple readers.

Now you can support a long-running query--just create a branch for it to run against and then delete the branch when it is done. A nice enhancement then would be to have temporary branches which are deleted when the program restarts--this would handle the problem of a crash in the middle of a long-running query.

No, I'm not rushing to do this. Rather, I want to spend the time working on web pages for now.

0 Comments:

Post a Comment

<< Home