shared memory, critical sections, priority inversion

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
floatT
Posts: 2
Joined: Wed Nov 02, 2005 12:00 am

shared memory, critical sections, priority inversion

Post by floatT »

Hi!

Known solutions for this problem (priority inversion) are priority inheritance and priority ceilings.

See: http://www.netrino.com/Publications/Glo ... rsion.html

Process p1 has high priority, process p2 has low priority but is working in it's critical section.
Scheduler lets p1 running and waiting (polling) that p2 leaves its critical section to jump in critical section itself.

Perhaps a third solution would be using locking / blocking (sleep and wakeup or wait and signal -> Tanenbaum Modern Operating Systems) p1 instead of doing polling and wasting cpu time, until p2 leaves its critical section?

So if p1 is blocked (sleep or wait), there wouldn't be any chance for p1 to run until p2 sends a "wakeup" after leaving critical region.

This method would leaving p1's and p2's priority untouched but protecting of priority inversion problem.

Am i right?

regards
vbbrett
Posts: 5
Joined: Sat May 07, 2005 11:00 pm

Re: shared memory, critical sections, priority inversion

Post by vbbrett »

you basically get the idea.
Perhaps to clarify a little:
In my OS, I allow certain applications(depending on security clearance) to practically stop the process scheduler so that certain code can be executed. If the program does not have the correct clearance, then is must call the OS and have the OS internally shutdown the scheduler and run the code.
Brett
Legend
Member
Member
Posts: 195
Joined: Tue Nov 02, 2004 12:00 am
Contact:

Re: shared memory, critical sections, priority inversion

Post by Legend »

floatT wrote: So if p1 is blocked (sleep or wait), there wouldn't be any chance for p1 to run until p2 sends a "wakeup" after leaving critical region.

This method would leaving p1's and p2's priority untouched but protecting of priority inversion problem.

Am i right?

regards
Err, that looks like priority inversion at its best!
*post*
Post Reply