Yeah, I do this all the time with STL and a critical section lock. A
list, or set and a lock is all you need. list of vectors for instance.
Set if you want it to automatically reject duplicated, a list for just
dumping data to it.

C



Tuesday, March 23, 2010, 2:22:35 PM, you wrote:

PI> I'd suggest you to use any kind of memory structure (like deque or
PI> whatever you prefer) for transferring data from one thread to another.
PI> Besides anything else it will be faster than using SQLite for this
PI> particular task.

PI> As you have already understood there's no way you can make 2
PI> connections to one in-memory database. Although you can use one
PI> connection from both thread so that threads will naturally block each
PI> other while they're doing their piece of job.


PI> Pavel

PI> On Tue, Mar 23, 2010 at 1:55 PM, Jakub Ladman <ladm...@volny.cz> wrote:
>> Hello to all
>>
>> I am back here to mailing list after about two years and also back to
>> programming with sqlite in general.
>>
>> I have new task and i do not know how to do it.
>>
>> 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).
>>
>> I do not know how to do two connections to memory stored table(fast, and not
>> wasting the flash memory writes).
>> The database opened as :memory: is separate for every thread, same as
>> temporary table with pragma temp_store = MEMORY.
>>
>> Do you have any clue?
>> Is it completely stupid way?
>>
>> Thank You
>>
>> Jakub Ladman
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
PI> _______________________________________________
PI> sqlite-users mailing list
PI> sqlite-users@sqlite.org
PI> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
Best regards,
 Teg                            mailto:t...@djii.com

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to