Blender UI Multithreading Progressbar The following question might've been asked several times, but I've found no satisfactory answer. 

Short question: 
How can I show progress of background task in Blender UI?

Explanation:
I have a long running task which I want to run in the background. I know there's some gotcha while using threads in python script, but since the task does not affect blender objects or data in any way, there's no reason the user should wait for it to complete (they can continue with other things in their pipeline). 

My thread works perfectly fine without any crashes, and I can show the progress on console. However to show the progress in the UI I do the following:


Have an integer/float property with subtype 'PERCENTAGE' which will be set to current progress. This might crash blender, since I'm actually modifying blender data. I've even tried this with some Blender versions and it kinda worked for pre-2.65. However it does not work for latest Blender builds.
In recent Blender version, I've found a new api named window_manager.progress_begin, window_manager.progress_update and window_manager.progress_end. I'm not sure if they are really intended to show progress, and if that is the case, how to use them.
EDIT: I've found an add-on template Always On Blank Render Engine by @Atom which seems to do the trick. It basically extends RenderEngine so all events can be captured. This is the first time I've tried it, and it can show progress similar to rendering progress (which is exactly what I want). However with a very quick test it seems that it'll also open a render preview window when the task is run, and also it shows the label as "Rendering" near the progressbar :-( Has anyone got any experience with extending RenderEngine?


Is there any option I can show progress in the UI? Or, is there any future plan regarding this?
The general mechanism to solve UI thread safety issues is to pass data from the worker thread to the main thread and then update the UI in the main thread using that data.

In this case you would create a modal operator that gets called regularly with a timer, see Text Editor &gt; Templates &gt; Python &gt; Operator Modal Timer for an example. Each time the operator modal function is called, you would check if the data has changed and update the UI accordingly.

How you pass the data between threads depends on the multithreading mechanism you are using. In Python there are a queue and multiprocessing.Queue modules that can be used with the threading and multiprocessing modules respectively. You put data in the queue in the worker thread and then get it out in the main thread.