Posts: 53
Joined: May 2017
Reputation:
0
I'm looking to implement threading in my video add-on and I was wondering if I create a thread will it continue to run during video playback or will it be paused until playback stops? The reason I ask is because I'm trying to figure out if I need to create a service or if I can avoid it.
Quote:pro·gram·mer (n): An organism capable of converting caffeine into code.
Posts: 1,506
Joined: Nov 2013
if you plugin spawns threads you are breaking API and all bets are off. mostly likely it will crash and burn at a later point.
Posts: 1,663
Joined: Jun 2011
Reputation:
119
Because of an issue with Python threading implementation in Kodi (I'm calling this "issue" because I don't think it is a bug but rather an implementation problem) a child thread always outlive the master Python process, unless explicitly terminated.
So yes, technically you can run background threads in your addon, but you need to make sure that your threads are properly terminated, especially when Kodi sets abortRequested flag.