Il 16/08/2010 21.04, Simon Slavin ha scritto:
> Where is the sqlite3_open command used ? Is it in the main thread or
> the writing thread ?

The main thread calls sqlite3_open, then registers a custom collation
function and creates the tables. The connection handle is then passed to
the worker thread that does the record insertions.
When the reading thread completes and the queue is empty the writing
thread closes the connection and exits.

By the way only some of the corrupted fields use the custom collation
function, so I'm inclined to rule it out as the culprit.
> Does the writing thread run the entire time the file is being written, or is 
> a new writing thread created for each batch of rows to be written, and once 
> it is finished it quits ?
>   

The writing thread is only one and runs until there are no more records
to insert, waiting on a condition variable should the queue be empty. In
practice the reading thread is much faster so this never happens.


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

Reply via email to