SimulIDE

SimulIDE FAQ

Rany

Priority Inversion Issues with OSEK Shared Resources in SimulIDE Tasks

Rany 1 week ago 32 views

Priority Inversion Issues with OSEK Shared Resources in SimulIDE Tasks
Greetings folks, I'm running a simulation in SimulIDE with three OSEK-based tasks, where two of them (A and C) need to access a common resource. Task A is set with a higher priority than C, but weirdly, even after C grabs the resource and starts its critical operations, A jumps in and preempts it mid-way. This feels like a classic priority inversion scenario, though I believed OSEK's mechanisms should prevent that. For context, I'm using a custom delay loop to mimic timing: void do_things(int ms=1){ unsigned long mul = ms * 504UL; unsigned long i; for(i=0; i

Admin Answer

Yeah, this is a common gotcha with OSEK—priority inversion can sneak in if the resource priorities aren't dialed in right. OSEK uses the priority ceiling protocol to dodge this, so bump the ceiling priority of your shared resource to match or exceed the highest-priority task that touches it (in this case, at least as high as A's). Double-check your declarations in the OIL file or config, and ensure every critical section is wrapped tightly with GetResource() before and ReleaseResource() after—no leaks there. Also, verify task activations and scheduling; if C's holding the resource too long due to that delay loop, it might invite preemption if ceilings aren't enforced. Test with shorter delays or real interrupts in SimulIDE to isolate. Once ceilings are set, A should inherit the priority while waiting, keeping things inversion-free. Good luck!

Verified Answer Last updated: 2 hours ago

Community Replies 0 Replies

Join the discussion and share your thoughts

No Replies Yet

Be the first to share your thoughts and help the community by replying to this question.

Login to Reply

Add Your Reply

Be respectful and helpful. Provide details to support your answer.

Please log in to add a reply.

SimulIDE Community Stats

FAQ statistics and activity

1

Questions

1

Replies

Need Help?

Can't find what you're looking for? Ask a question and get help from our community!

Login to Ask