When using the Xilkernel, changing the scheduling to SCHED_PRIO might expose a race condition/corruption.
If you select priority scheduling and have multiple threads with the same priority, then scheduling between the same priority threads should be round robin time-sliced.
This means that if we have 2 threads with priority 2 and the Xilkernel is set up with the priority scheduling option, we expect each thread to execute for 1 tick each in a round robin manner.
The cause of the issue was that when a thread was releasing semaphore that the other thread with the same priority was waiting for, the other thread was getting activated. That is against the scheduling policy.
To work around this issue, Use the patched version of the Xilkernel attached to this Answer Record.
To use this version, download the Xilkernel locally into a "bsp" folder. In SDK, go to Xilinx Tools -> Repositories -> New.
|Name||File Size||File Type|