Here is a TaskManagerComponent I made a while ago: This monogame component helps handling task execution in a background thread, and synchronization in the game thread. · GitHub
After registering the component on Game Initialization, you can execute background tasks, like so:
taskManager.ExecuteInBackground(() =>
{
//execute something heavy in background thread
System.Threading.Thread.Sleep(2000);return Color.Aqua; // return color }).Then(r => { //Here we are back in the game thread, OnUpdate() var clearColor = r.Result; // Result returns Color.Aqua });