I have the following simple problem. I am trying to auto initialize and run these threads. Even they can work one by one periodically. However, i am even if i am trying to switch to ccc thread from rcv thread using sched_run() or thread_yield(); it never runs the ccc thread. I tried to thread_sleep, but it is just another overhead and overload to run multiple threads sequentially.
After the creating of this thread the main thread itself yields and the new thread is scheduled due to its higher priority (less means higher priority like with Unix nice values). When the new Thread yields it always get scheduled again, since there is no thread with an higher priority.
This thread is never created since the main Thread is not scheduled again.
You can use the option "THREAD_CREATE_WOUT_YIELD" to prevent the main thread from yielding. This would result in both threads are started and afterwards scheduled in an alternating way (assuming you yield in both threads), but would prevent you main loop from getting scheduled. If you need your main thread to run also, you can use the same priorities for all three threads.
Please not that the documentation states "Avoid assigning the same priority to two or more threads.". But i have no clue for what reason.
The reason is given right in the beginning of the documentation [1]. Sounds like the reasons is pretty much the behavior you try to achieve so it should be fine if you use thread_yield correctly.