Thread: Job Manager
View Single Post
Old 08-10-2013, 08:38 AM   #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,450
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You cannot use multiprocessing. On unix multiprocessing does a fork() without exec() which is totally broken for something as complex as calibre. multiprocessing is really a bit of a joke of a module.

And on windows launching a separate worker process that has to load python, then load the db would take *seconds* on a typical low powered notebook.

You need to step back from the abstract async vs. sync philosophical debate and think about actual concrete implementation.

A sync implementation updates the database in under 0.1 seconds, which is imperceptible to the user, even though the event loop might be in fact be blocked for that 0.1 second. An async implementation will result in the value *the user sees* not changing for more than 0.1 seconds, and for ~ 1 second on slower computers which is absolutely unacceptable.
kovidgoyal is offline   Reply With Quote