0

I'm writing a python program which accesses two different SQLITE3 databases in two different python threads. Am I right in thinking that this will use 2 cores on my machine?

Well3
  • 121
  • 5

1 Answers1

0

This reply implies that the pysqlite module releases the GIL while calling the C-language sqlite API. So both cores must be used efficiently. What happens when the result sets are processed by Python is another matter, and there can be a slow-down related to the global interpreter lock. In the case of relatively fast SQL queries, using processes instead of threads could be a bit faster. (I did not check the pysqlite source code myself).

Community
  • 1
  • 1
Mike Bessonov
  • 676
  • 3
  • 8