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.
|