Fastest way to switch between two tasks at FreeRTOS

Hi, I am a beginner with FreeRTOS. I’m looking for the fastest way to switch between two tasks with the same priority after one walkthrough of the loop. So the second task can start and after one pass it should switch back to the first task again. I tried already with OS_Delay(). But I it took to much time. Thanks for your answers.

Fastest way to switch between two tasks at FreeRTOS

vTaskYield() will let any other ready task of the same priority run. A second comment, if you really want the execution to be first Task1 run and does it thing, while Task2 stays idle, then Task2 runs while Task1 stays idle, to just combine Task1 and Task2 inside the same processing loop inside a single task. (This doesn’t apply if Task1 might block for something, and during that time Task2 should run).