Hey all,

I've come to the sad realization that we need to make our sqlite
wrapper threadsafe so it can be used on multiple threads without
consumers having to worry about threadsafety themselves.  So, I wanted
to make sure all my assumptions about sqlite data structures are
correct so I don't introduce issues before undertaking this task.

First, I know that the sqlite3 object can be accessed on multiple
threads, but it must only be used by one thread of control at a time.
It is also my understanding that this same constraint applies to
sqlite3_stmt objects - they can only be used by one thread of control
at a time but accessed on multiple ones.  What I am not so sure about,
however, is if I have to protect the sqlite3 object that "owns" the
statement when I'm calling methods on it such as sqlite3_bind_*
interfaces, sqlite3_step, sqlite3_reset, and sqlite3_finalize.
Conservatively, I'm assuming yes on all of the above, but I hope I'm
wrong for at least some of those.  I would, however, expect to have to
protect the sqlite3 object when calling sqlite3_prepare_v2.

Clarification on this would be greatly appreciated.

Cheers,

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

Reply via email to