> I need an application consisting two threads. > In one of them i need to store incomming "messages" (one message is 1 to 8 > bytes of data) to temporary table existing only in memory. > It needs to be fast, storing hundreds of messages per second. > There i have a trigger deleting old rows and creating some sort of circular > buffer. > In separate thread there should be done some selects (read only) on this > table > sorting the informations and storing them into separate table(s) located on > disk (jffs2 filesystem). > > Are you talking about two processes? If not, why these two threads have to have separated connections? If it's not necessary, I'd opened disk db, attach memory database to it (see http://www.sqlite.org/inmemorydb.html ) and pass this db handle to both threads. One of them in this case will use only memory part of the base (fast appending), another one will do necessary selects and inserts to disk db part. After the db is closed, you will only have disk part left. I don't know more about locking logic in this case, because for performance reasons, it would be better for example, if memory part only locked its part not affecting the disk part.
Max _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users