Re: Thread Scheduling question

Peter A. Bigot

> I'm not quite sure what you are trying to mitigate, exactly.  This is the desired behavior.  You WANT your two custom threads to run instead of  your main thread, that's why they're higher priority.

I think the mitigation is of Zephyr's default behavior: that the main thread is preemptible by default.  I've also run into this where starting a repeating timer with no initial delay in main caused a work item to be submitted (from interrupt) and started (from system work thread, which is default cooperative) before I'd finished configuring the work item back in main.

Not that it's wrong, but it's unexpected to have main be preemptible, and since every thread declared in the samples and drivers is cooperative people just starting with threads are likely to make this "mistake".


Join to automatically receive all group messages.