View Single Post
Old 03-16-2025, 07:13 AM   #52
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,382
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
device jobs in calibre are in the main process. In a plugin it's up to you to decide if you want thread or process based background jobs. The existing lock is single process and I dont think I want to make it an IPC lock as the overhead for that is too large.

So either use thread based background jobs in the plugin or simply get a write lock on the temp db path in your plugin. You can do so by opening a sqline connection to it and starting a trnsaction. sqlite IIRC is single writer so that should serve as a fine IPC lock.
kovidgoyal is offline   Reply With Quote