View Single Post
Old 08-10-2021, 11:34 PM   #8
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,440
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
ParallelJob is designed to work with pre-defined entry points in ipc/worker.py that are run in worker processes. ThreadedJob is meant for in-process jobs.

However, either of these classes are meant to be used only with calibre's jobs system (the jobs button in the main calibre gui). If you want to do jobs in multiple processes as part of larger job, your best bet is to use the ipc/simple_worker.py module. See for example how it is used in srv/render_book.py where calibre uses multiple worker processes to transform a book into a form suitable for the calibre viewer.
kovidgoyal is offline   Reply With Quote