Re: [sqlite] Threading (again)
SQLite is completely threadsafe. So we can share a single database connection across threads, it the underlying OS is Okay. But I guess we can not share a sqlite3_stmt prepared statement across threads threads. Am I correct. Or am I missing something? -- Sabyasachi
Re: [sqlite] Threading (again)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 D. Richard Hipp wrote: > SQLite is completely threadsafe in 3.5.2. But that does not mean > that running SQLite will magically fix threading bugs in Linux 2.4 > kernels or in GLIBC. The FAQ warns you to beware these problems. Thanks for the details. You may want to update the FAQ to be a little more detailed. Do you have any additional code in the TCL wrapper that ensures sane thread usage, or do you rely entirely on SQLite itself? Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHSg6qmOOfHg372QQRAmACAKC6hvEEcLNB/OPvidt+RJquyppWiQCfWTPL iaf+D+TF0by06ysTzgI/ukE= =bX9X -END PGP SIGNATURE- - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Threading (again)
On Nov 25, 2007, at 2:21 PM, Roger Binns wrote: I was under the impression that SQLite 3.5.2 is completely threadsafe, meaning you can make any relevant API call in any thread. Examples of things I thought are safe are: - - Using statements from the same connection in different threads - - Calling step on a statement in one thread and then calling it again in another thread - - Doing some blob i/o in one thread and then doing more in another The FAQ currently says it is somewhat safe. http://www.sqlite.org/faq.html#q6 Is the FAQ out of date? SQLite is completely threadsafe in 3.5.2. But that does not mean that running SQLite will magically fix threading bugs in Linux 2.4 kernels or in GLIBC. The FAQ warns you to beware these problems. By "threadsafe" in 3.5.2, that means you can call SQLite simultaneously from different threads using the same database connection. SQLite contains its own mutexes to serialize access. D. Richard Hipp [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Threading (again)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Roger Binns wrote: > I was under the impression that SQLite 3.5.2 is completely threadsafe, > meaning you can make any relevant API call in any thread. I should be clearer what I meant by threadsafe. The most important notion is that there is no way to corrupt SQLite itself no matter which APIs are called in any thread or concurrently. I'd expect the misuse error if trying to do bad things such as simultaneously calling sqlite3_step in two different threads on the same statement at the same time (one call should succeed, the other getting misuse). The second is that APIs will work if called in the correct order but with the calls happening in different threads. If there is any possibility for corrupting SQLite internals based on what threads calls are happening in, or if calls can't happen in different threads then I'll need to leave the thread protection in. Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHSfHSmOOfHg372QQRAnNQAJ0T8uWac3zE9kaJ9c43bfuqE5SGCwCgwS/1 2m+FAVbJ4qTYOctlEaFyKjY= =67SP -END PGP SIGNATURE- - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Threading (again)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I was under the impression that SQLite 3.5.2 is completely threadsafe, meaning you can make any relevant API call in any thread. Examples of things I thought are safe are: - - Using statements from the same connection in different threads - - Calling step on a statement in one thread and then calling it again in another thread - - Doing some blob i/o in one thread and then doing more in another The FAQ currently says it is somewhat safe. http://www.sqlite.org/faq.html#q6 Is the FAQ out of date? The background is that the wrapper I produce (APSW) has code in it that ensures a connection and all objects derived from it (statements etc) are only used in the same thread. It would be nice to rip all that code out, but if moving/using items between threads could still cause problems then I'll have to leave it in. Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHSctTmOOfHg372QQRAvdAAJ4+QVZy0N0SoWQ7jo1mdAKBG1AHMgCeOuvL aQ1y5dYewhzNrukPcNncd/w= =14KI -END PGP SIGNATURE- - To unsubscribe, send email to [EMAIL PROTECTED] -