1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/sys_sched_round_robin
2023-02-27 12:31:04 +01:00
..
tests test/sys_sched_round_robin: use sleep instead of mutex 2021-12-08 13:14:27 +01:00
main.c test/sys_sched_round_robin: use sleep instead of mutex 2021-12-08 13:14:27 +01:00
Makefile Merge pull request #17434 from kaspar030/murdock_use_emulators 2022-04-06 14:41:48 +02:00
Makefile.ci examples,tests: Update Makefile.cis 2023-02-27 12:31:04 +01:00
README.md

Round Robing Scheduling Test

This application is a simple test case for round-robin scheduling. Two threads are started with the same priority. The first thread is a busy loop and is started first. The second thread unlocks a mutex allowing the main thread to continue and exit.

Without Round Robin scheduling the busy loop thread would run indefinitely, with round-robin in eventually getting de-scheduled allowing the main thread to run and exit.

Usage

By default sched_round_robin is included:

make tests/sys_sched_round_robin flash term

...Board Initialisation...

Help: Press s to start test, r to print it is ready
s
START
main(): This is RIOT! (Version: ...)
starting threads
double locking mutex
mutex_thread yield
bad thread looping
unlock mutex
[SUCCESS]

It can be excluded from the build by setting the command-line argument NORR=1:

NORR=1 make tests/sys_sched_round_robin flash term

...Board Initialisation...

Help: Press s to start test, r to print it is ready
s
START
main(): This is RIOT! (Version: ...)
starting threads
double locking mutex
mutex_thread yield
bad thread looping

This will loop endlessly as the bad thread does not release the CPU, make test will timeout in that case.