Wykres commitów

2 Commity (parse-bytecode)

Autor SHA1 Wiadomość Data
Damien George 05a4859585 stmhal: Implement a proper thread scheduler.
This patch changes the threading implementation from simple round-robin
with busy waits on mutexs, to proper scheduling whereby threads that are
waiting on a mutex are only scheduled when the mutex becomes available.
2017-02-15 13:28:48 +11:00
Damien George 882ec01e42 stmhal: Initial implementation of multithreading, currently disabled.
This patch brings the _thread module to stmhal/pyboard.  There is a very
simple round-robin thread scheduler, which is disabled if there is only
one thread (for efficiency when threading is not used).

The scheduler currently switches threads at a rate of 250Hz using the
systick timer and the pend-SV interrupt.

The GIL is disabled so one must be careful to use lock objects to prevent
concurrent access of objects.

The threading is disabled by default, one can enabled it with the config
option MICROPY_PY_THREAD to test it out.
2017-01-31 18:42:35 +11:00