C# Parallelism on Raspberry Pi doesn't work!
Posted: Tue Jul 21, 2020 11:48 pm
I'm making a Discord Bot and I need to use C# Task Parallelism.
I develop the program in Windows 10, and then I build it to the Raspberry Pi.
All works correctly, but the Task Parallelism.
As you can see in the image, all is working properly, with one difference: "15 second test started".
That is not running on the right side (Raspberry Pi one).

Function that runs in parallel: (Simplified)
Code that trigger it to start running:
The code is right, I only show it in case it can help you.
I don't know why, in the Raspberry Pi, it is like ignored.
Any ideas? Thank you
I develop the program in Windows 10, and then I build it to the Raspberry Pi.
All works correctly, but the Task Parallelism.
As you can see in the image, all is working properly, with one difference: "15 second test started".
That is not running on the right side (Raspberry Pi one).

Function that runs in parallel: (Simplified)
Code: Select all
private async Task Update()
{
while (!connected) {
}
while (connected) {
if (connected)
{
await Task.Delay(15000).ConfigureAwait(false);
Console.WriteLine("15 Second test started!");
}
}
}
Code: Select all
_ = Task.Run(() => Update());
//continue doing other things
I don't know why, in the Raspberry Pi, it is like ignored.
Any ideas? Thank you