Posts Tagged ‘concurrency’

Concurrency in SQLite

October 20th, 2010

During this week, was working on the usage of local database for caching of values. Using C#, we decided to use System.Data.SQLite found here. Using a relationship oriented database, i had trouble with some concurrency issues. The database file would be locked when the it is being utilized. Basically, SQLite allows for multiple reads but single writes. To play safe, and due to the use case, i decided to segregate the writes and reads, simulating it like the Dining Philosophers Problem. I created a controller class to act as a waiter, wrappers for read and write. On creation / query, the wrapper will ask permission from the controller class. Thereafter, once it completes, a closing event will invoke and un block any queue.
Still require some addition checks and some minor tweaks. Hopefully this works out fine. ;)

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)
DiggTwitterTechnorati FavoritesRedditNewsVineFacebookShare
Get Adobe Flash playerPlugin by wpburn.com wordpress themes