Reader preference, writer preference, and task-fair reader-writer locks are shown to cause undue blocking in multiprocessor real-time systems. Phase-fair reader writer locks, a new class of reader-writer locks, are proposed as an alternative. Three local-spin phase-fair lock algorithms, one with constant remote-memory-reference complexity, are presented and demonstrated to be efficiently implementable on common hardware platforms. Both taskand phase-fair locks are evaluated and contrasted to mutex locks in terms of hard and soft real-time schedulability—each under both global and partitioned scheduling—under consideration of runtime overheads on a multicore Sun “Niagara” UltraSPARC T1 processor. Formal bounds on worst-case blocking are derived for all considered lock types.
Björn B. Brandenburg, James H. Anderson