v17 xbmc.executebuiltin (and others) hangs when called from multiprocessing.Process
#1
In my script addon I use the xbmc.service extension point to load a python file at login. In that python file I create a number of worker processes using multiprocessing.Process module.

When calling either xbmc.executebuiltin, xbmc.executeJSONRPC or xbmc.getCondVisibility from one of the worker process that process just blocks or hangs forever. Copying the same code to the main loop returns results immediately.

However calling xbmc.Player().isPlaying() does work from the worker processes.

I'm stuck. Can you only use the xbmc.* commands from the main process?
Reply
#2
(2019-04-03, 18:51)djbloc Wrote: In my script addon I use the xbmc.service extension point to load a python file at login. In that python file I create a number of worker processes using multiprocessing.Process module.

When calling either xbmc.executebuiltin, xbmc.executeJSONRPC or xbmc.getCondVisibility from one of the worker process that process just blocks or hangs forever. Copying the same code to the main loop returns results immediately.

However calling xbmc.Player().isPlaying() does work from the worker processes.

I'm stuck. Can you only use the xbmc.* commands from the main process?

Link to code?
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#3
uwikolabev (paste)

A worker process receives message from a queue and passes them to this class to be processed. This is the current version.

Timeline:
- Blocked on L62. So commented out
- Added executeJSONRPC lines and then blocked on L70
- Added L14 and now blocks on this line.
Note: L12 & L13 do not block and return correctly

This is the similar lines copied to the main function. See L49-56.

lalemuhimu (paste)
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc.executebuiltin (and others) hangs when called from multiprocessing.Process0