Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Homepage
Measure thread switching time by implementing semaphore ping-pong between two threads¶
This mbed program starts two threads with realtime-priority. Each of them is waiting for the other to give its semaphore and gives the other thread's semaphore as a reaction. Once started, this algorithm results in fast thread switches, enforced by the semaphores.
To allow measurement, one thread sets a GPIO output, while to other one clears it.
Measurements are performed on a NUCLEO-F767ZI board https://os.mbed.com/platforms/ST-Nucleo-F767ZI/.
mbed-os-5.12.3¶
Measured gpio_out output frequency, whitch contains actually two thread switches:
- 6.5 - 7.0 usec (154 kHz - 143 kHz)
