summaryrefslogtreecommitdiff
path: root/stmhal/pybthread.c
AgeCommit message (Collapse)Author
2017-03-22stmhal/pybthread: Allow interrupts to work during lock/unlock of mutex.Damien George
When locking/unlocking a mutex we only need to protect against a thread switch, not general interrupts.
2017-02-15stmhal: Implement a proper thread scheduler.Damien George
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-01-31stmhal: Initial implementation of multithreading, currently disabled.Damien George
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.