CHERIoT-Platform / cheriot-rtos

The RTOS components for the CHERIoT research platform
MIT License
128 stars 44 forks source link

Should interrupts be enabled when the scheduler yields? #56

Open rmn30 opened 1 year ago

rmn30 commented 1 year ago

As of the merge of #44 e24f37f disabled interrupts when yielding in the scheduler. It's not clear whether the comment on yield_interrupt_enabled which describes the need for enabling interrupts still applies. A simple test of a thread calling thread_sleep with interrupts disabled worked as expected: the thread was suspended, yielded and the idle thread was scheduled allowing timer interrupts to be received.

We should think about this and, at the very least, fix the comment.

rmn30 commented 4 months ago

I still don't understand the comment and it is now even more confusing as the function does not enable interrupts. If you think it's fine as is we should rename the function to just yield and remove the comment.

davidchisnall commented 4 months ago

I think the comment is wrong and we should rename the function.