From 6a4634d507efbbc35776075f2281835419d09f89 Mon Sep 17 00:00:00 2001 From: Vincent Guittot Date: Mon, 7 Jul 2014 17:20:52 +0200 Subject: resource: new sync resource new resources that ensure an atomic : signal and wait sequence With 2 tasks that wake up each, we can have the situation that the wakee preempts the waker before the later waits on condition. This leads to a situation where both tasks are waiting to be woken up by the other one Signed-off-by: Vincent Guittot --- doc/taskset.json | 99 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 51 insertions(+), 48 deletions(-) (limited to 'doc') diff --git a/doc/taskset.json b/doc/taskset.json index 25b39e0..8f5d6e6 100644 --- a/doc/taskset.json +++ b/doc/taskset.json @@ -1,68 +1,71 @@ { /*"resources" : 4,*/ "resources" : { - "m0" : { "type" : "mutex" }, - "sync_mutex" : { "type" : "mutex" }, - "wait" : { "type" : "wait" }, - "trig" : { "type" : "signal", "target" : "wait" }, - "m1" : { "type" : "mutex" }, - "wake" : { "type" : "wait" }, - "broad" : { "type" : "broadcast", "target" : "wake" }, - "m2" : { "type" : "mutex" }, - "s1" : { "type" : "sleep" }, - "s2" : { "type" : "sleep" }, - "r1" : { "type" : "run" }, - "r2" : { "type" : "run" }, + "trig1_mutex" : { "type" : "mutex" }, + "wait1" : { "type" : "wait" }, + "trig1" : { "type" : "signal", "target" : "wait1" }, + "trig2_mutex" : { "type" : "mutex" }, + "wait2" : { "type" : "wait" }, + "trig2" : { "type" : "signal", "target" : "wait2" }, + "trig3_mutex" : { "type" : "mutex" }, + "wait3" : { "type" : "wait" }, + "trig3" : { "type" : "signal", "target" : "wait3" }, + "sync3" : { "type" : "sync", "target" : "wait3" }, + "trig4_mutex" : { "type" : "mutex" }, + "wait4" : { "type" : "wait" }, + "trig4" : { "type" : "signal", "target" : "wait4" }, + "r0" : { "type" : "run" }, }, "tasks" : { - "thread0" : { - "exec" : 1000, - "period" : 20000, - "deadline" : 8000, - "cpus" : [0], - "lock_order" : ["r1", "m0", "trig"], + "AudioOut" : { + "exec" : 5000, + "period" : 24000, + "deadline" : 24000, + "priority" : -19, + "cpus": [0], + "lock_order" : ["r0", "trig1"], "resources" : { - "r1" : { "duration" : 200 }, - "m0" : { "duration" : 500 }, - "trig" : { "duration" : 0, "access": ["sync_mutex"] }, + "r0" : { "duration" : 275 }, + "trig1" : { "duration" : 0 }, } }, - "thread1" : { - "exec" : 5000, - "period" : 20000, + "AudioTrack" : { + "exec" : 300, + "period" : 24000, + "deadline" : 24000, + "priority" : -16, "sleep" : false, - "lock_order" : ["wait", "m0", "broad", "r1", "broad"], + "lock_order" : ["wait1", "r0", "trig2"], "resources" : { - "wait" : { "duration" : 0, "access": ["sync_mutex"] }, - "m0" : { "duration" : 1000 }, - "broad" : { "duration" : 0}, - "r1" : { "duration" : 1000 }, + "wait1" : { "duration" : 0, "access": ["trig1_mutex"] }, + "r0" : { "duration" : 300 }, + "trig2" : { "duration" : 0 }, } }, - "thread2" : { - "loop" : 100, - "exec" : 1000, - "period" : 20000, + "mp3.decoder" : { + "exec" : 1150, + "period" : 24000, + "deadline" : 24000, + "priority" : -2, "sleep" : false, - "lock_order" : ["wake", "m2", "wake", "m2"], + "lock_order" : ["wait2", "r0", "sync3"], "resources" : { - "wake" : { "duration" : 0, "access": ["m1"] }, - "m2" : { "duration" : 200 }, + "wait2" : { "duration" : 0, "access": ["trig2_mutex"] }, + "r0" : { "duration" : 1000 }, + "sync3" : { "duration" : 0, "access": ["trig3_mutex"] }, } }, - "thread3" : { - "exec" : 1000, - "period" : 20000, - "deadline" : 15000, - "delay" : 15000, - "sleep" : true, - "lock_order" : ["r1", "s1", "r1", "s2", "r2" ], + "OMXCall" : { + "exec" : 300, + "period" : 24000, + "deadline" : 24000, + "priority" : -2, + "sleep" : false, + "lock_order" : ["wait3", "r0", "trig3"], "resources" : { - "wake" : { "duration" : 0, "access": ["m1"] }, - "r1" : { "duration" : 200 }, - "s1" : { "duration" : 2000 }, - "r2" : { "duration" : 200 }, - "s2" : { "duration" : 1000 }, + "wait3" : { "duration" : 0, "access": ["trig3_mutex"] }, + "r0" : { "duration" : 300 }, + "trig3" : { "duration" : 0, "access": ["trig3_mutex"] }, } }, }, -- cgit v1.2.3