Re: [riot-devel] Scheduler: Supporting Cooperative Threading

2018-06-13 Thread Kaspar Schleiser
Hi Juan, On 06/13/2018 10:27 AM, Juan Ignacio Carrano wrote: >>> Coroutines make it possible to program asynchronous code in a >>> blocking style - see "await". This is more natural and easier that >>> using callbacks. >> How does it compare to sending / receiving messages? >> > > Using messages

Re: [riot-devel] Scheduler: Supporting Cooperative Threading

2018-06-13 Thread Juan Ignacio Carrano
Hi Kaspar, On 06/12/2018 11:05 PM, Kaspar Schleiser wrote: RIOT's scheduler used to work like that: any preemption by a higher priority thread would advance the current priority's circular runqueue. That has been fixed years ago. Nowadays, only if a thread calls explicit thread_yield() or it bl

Re: [riot-devel] Scheduler: Supporting Cooperative Threading

2018-06-12 Thread Kaspar Schleiser
Hi Juan, On 06/12/2018 12:27 PM, Juan Ignacio Carrano wrote: > The current RIOT scheduler will only switch between threads with the > same priority if there is an explicit yield, or if there occurs a > preemption by a higher priority thread. RIOT's scheduler used to work like that: any preemption

[riot-devel] Scheduler: Supporting Cooperative Threading

2018-06-12 Thread Juan Ignacio Carrano
Hello Rioters, I'm trying to figure out how could cooperative multithreading / fibers / coroutines be used in RIOT. There is something already in the scheduler, but right now it looks more like an artifact of the implementation than a proper feature. Why --- Pre-emptive threading is hard t