This PR will run the progress callback on separate thread to avoid blocking the decoder loop. If the progress callback is doing a heavy workload it would previously slow down the the decoding waiting for it to complete, this change will allow the callback to be called without waiting. This will potentially result in more loops of the decoder while waiting for the callback to make an early stopping decision, but faster overall.
This PR will run the progress callback on separate thread to avoid blocking the decoder loop. If the progress callback is doing a heavy workload it would previously slow down the the decoding waiting for it to complete, this change will allow the callback to be called without waiting. This will potentially result in more loops of the decoder while waiting for the callback to make an early stopping decision, but faster overall.