I was using spaCy's multiprocessing pipe(
https://github.com/explosion/spaCy/b...guage.py#L1581) in ThreadedJob but found it will terminate calibre, I think the code should looks like this:
Code:
from multiprocessing import Process
from threading import Thread
def fun():
while True:
pass
class JobThread(Thread):
def run(self):
# code in ThreadedJob
p = Process(target=fun)
p.start()
p.terminate()
JobThread().start() # pretend it's ThreadedJobServer
The process created in ThreadedJob is still running but the calibre main process is terminated.
I also want to know the difference between calibre's ParallelJob and ThreadedJob.