LdB wrote: ↑
Thu Feb 28, 2019 4:26 pm
The easiest is to route the QA7 one to each core and each core handles it's irq, they will all have to share the same frequency because the prescaler and divider is global from the 38.4Mhz.
That's exactly what I do. This way I have per core counters and per core scheduler IRQ. Having the same freq is actually helping, makes task sync easier (I also set the crystal as clock source instead of APB)
Ultibo wrote: ↑
Thu Feb 28, 2019 10:56 pm
What is your rationale for choosing to make the top 3 priority levels uninterruptible?
Why not (as we do in Ultibo) simply have a flag
Actually that acts like a flag, technically it works exactly as you described. In the ISR where you use "if (rtflag)" I use "if (priority < 3)" to decide if the task is uninterruptible. I already had the priority queues, and a nice ACL system to check if a user application can be put in one particular queue with the setprio() system call, and I didn't wanted to introduce a new system call. I expect varying tasks (not all known at start), in that regard this is a bit like a general purpose OS, so I also had to make sure that a lower priority task won't make a higher priority task starving (hog the CPU as you put it very expressively). Pretty much that's all the reasons behind.
I have 3 top levels because my priority queues are like this: 0-system (only for emergency tasks, and for the built-in debugger if compiled in), 1-real time tasks, 2-device driver tasks, 3-servers, (3+)-applications. I have other reasons than scheduler to have level 2 and 3 in a micro-kernel architecture (drivers are special tasks, and servers are user space parts of the kernel).