How to share a :memory: database between different process in python using python sqlite3 package
How to share a :memory: database between different process in python using python sqlite3 package scenario is shown as below,i got many processes to do CPU-bound work and read only on the same database,i know cache and uri key words could be used for sqlite to share database cache between threads,but how about between processes?it's better to be available both for linux and windows, Thank you! def run(self): self.phyconn = apsw.Connection(self.fileName) self.memconn = apsw.Connection(":memory:") try:#backup.__exit__() just make sure copy if finished,not close backup,so with is good,memconn is still exist when out with self.memconn.backup("main", self.phyconn, "main") as backup: # call with 0 to get the total pages backup.step(0) total = backup.pagecount stepped = 0 one_percent = total if total < 100 else total // 100 last_percentage = 0 while step...