View Single Post
Old 11-10-2014, 03:39 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,448
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Speaking from some knowledge of device drivers but no knowledge of the iOS plugins:

It appears that the iOS reader plugin is acting as a device driver. If so, then all methods in that plugin are called on the device manager thread, which is not the GUI thread. Every method in the plugin must complete its task during a single call. Unless you are very careful, it must not use sub-threads to do anything.

The sync_booklists call is usually called as part of a set of job steps.

1) [Device thread] Connect to device
2) [Device thread] Initialize the device
3) [Device thread] Get booklists (metadata) from device
4) [GUI thread] match books from device to calibre library
5) [Device thread] Send metadata back to the device (sync_booklists)
6) [GUI thread] Update views

The profile_db method will be called on the device thread. You can't trust the printout order because of threading.

You must be absolutely sure that nothing in the user interface plugin (marvin XD) calls any method in the iOS reader applications plugin, because that could cause threading problems.

I have no idea if this helps.
chaley is offline   Reply With Quote