I have found the reason for many Not Responding


#1

OK, After many hours having to redo the same albums over and over again due to even 4 albums ending up with “Not Responding” and having to kill the process and start again, I have discovered the reason.
Picard is a UWP application,
Windows therefore decided to suspend any UWP application that it feels is using too much CPU.
On windows 10 if you look on task manager there will be in the sub entry for picard a small circle with a vertical line through it, Hover over this and it will tell you that Windows has suspended this process because it was using too much CPU.

There is a way to get around this by telling the app not to suspend, MSDN says this

You can prevent your UWP app from suspending when it is deactivated or minimized.

This opportunity was introduced in version 10.0.10240.0.

To achive this you should use the ExtendedExecutionSession API. Look at the documentation.

You can use this API in some way like:

var extendedExecutionSession = new ExtendedExecutionSession(); extendedExecutionSession.Reason = ExtendedExecutionReason.Unspecified; var extendedExecutionResult = await extendedExecutionSession.RequestExtensionAsync(); if (extendedExecutionResult != ExtendedExecutionResult.Allowed) { //extended execution session revoked extendedExecutionSession.Dispose(); extendedExecutionSession = null; }

You can insert this code in a method that is the entry point of your UWP app and handles the launch, depending of the way which you have chosen (OnLaunched or OnActivated).

We just need the Developers to either use this - or put some of the grunt work into a thread that doesnt lock up the UI.