Hi, those who read the cvslog list know that I have some problems with threading in the kaa.vfs module. After some thinking, maybe using a thread isn't such a good idea. I used a thread because a reader can block when the writer writes the db and the writer can block when there are still readers. The last one doesn't matter, it is only the server but the first one may be a problem.
To avoid blocking, the current vfs code uses a little trick. When calling add_object or update_object, the db is not changed right now becuase this would block the db until we call commit() the next time. I added some debug for adding 706 files to the db and calling commit after that. The whole operation takes 0.56 seconds but there are some delays caused by threading (e.g. main loop wakeup). Using a small test app, adding 1000 directories takes 0.59 seconds. More debugging: if I remove the keyword code in the db it only takes 0.25 seconds. More testing: 0.1 seconds are lost in the executemany in the keyword code. To summarize my problem / idea: remove the thread in the db. First of all, it is very unlikly we read at the same time as something else is writing. Second, forcing a commit every let's say 100 updates will reduce the block to 0.07 seconds. Maybe we could also speed up the keyword stuff or make an option not to update the keywords and do it later when the db is idle. If we do that, 100 add + commit would only block the db for 0.04 seconds. Comments please Dischi -- In the beginning, there was nothing. And God said, 'Let there be Light.' And there was still nothing, but you could see a bit better.
pgphOIxX9zS54.pgp
Description: PGP signature