From 3e1349d29fa00db1fab3a811b60bc9d8de0355e4 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 30 Sep 2016 10:45:14 -0700 Subject: 3431 Improvements to syntax highlighting, particularly for Mu code in C++ files. --- html/072scheduler.cc.html | 81 ++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 40 deletions(-) (limited to 'html/072scheduler.cc.html') diff --git a/html/072scheduler.cc.html b/html/072scheduler.cc.html index 1d2681fa..648f22b7 100644 --- a/html/072scheduler.cc.html +++ b/html/072scheduler.cc.html @@ -16,14 +16,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.CommentedCode { color: #6c6c6c; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.CommentedCode { color: #6c6c6c; } +.Identifier { color: #fcb165; } --> @@ -39,14 +40,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color //: guarantees on how the operations in each are interleaved with each other. :(scenario scheduler) -def f1 [ +def f1 [ start-running f2 # wait for f2 to run { jump-unless 1:num, -1 } ] -def f2 [ +def f2 [ 1:num <- copy 1 ] +schedule: f1 @@ -232,7 +233,7 @@ put(Recipe_ordinal,:(scenario scheduler_runs_single_routine) % Scheduling_interval = 1; -def f1 [ +def f1 [ 1:num <- copy 0 2:num <- copy 0 ] @@ -243,12 +244,12 @@ def f1 [ :(scenario scheduler_interleaves_routines) % Scheduling_interval = 1; -def f1 [ +def f1 [ start-running f2 1:num <- copy 0 2:num <- copy 0 ] -def f2 [ +def f2 [ 3:num <- copy 0 4:num <- copy 0 ] @@ -264,14 +265,14 @@ def f2 [ +run: {2: "number"} <- copy {0: "literal"} :(scenario start_running_takes_ingredients) -def f1 [ +def f1 [ start-running f2, 3 # wait for f2 to run { jump-unless 1:num, -1 } ] -def f2 [ +def f2 [ 1:num <- next-ingredient 2:num <- add 1:num, 1 ] @@ -281,21 +282,21 @@ def f2 [ :(scenario start_running_immediately_updates_refcounts_of_ingredients) % Scheduling_interval = 1; -def main [ +def main [ local-scope create-new-routine # padding to make sure we run new-routine before returning dummy:num <- copy 0 dummy:num <- copy 0 ] -def create-new-routine [ +def create-new-routine [ local-scope - n:&:num <- new number:type + n:&:num <- new number:type *n <- copy 34 start-running new-routine, n # refcount of n decremented ] -def new-routine n:&:num [ +def new-routine n:&:num [ local-scope load-ingredients 1:num/raw <- copy *n @@ -318,11 +319,11 @@ increment_any_refcounts(ingredient} :(scenario next_ingredient_never_leaks_refcounts) -def create-space n:&:num -> default-space:space [ - default-space <- new location:type, 2 +def create-space n:&:num -> default-space:space [ + default-space <- new location:type, 2 load-ingredients ] -def use-space [ +def use-space [ local-scope 0:space/names:create-space <- next-ingredient n:&:num/space:1 <- next-ingredient # should decrement refcount @@ -330,7 +331,7 @@ def use-space [ n2:num <- add *n/space:1, 1 reply n2 ] -def main [ +def main [ local-scope n:&:num <- copy 12000/unsafe # pretend allocation with a known address *n <- copy 23 @@ -345,10 +346,10 @@ def main [ //: back to testing 'start-running' :(scenario start_running_returns_routine_id) -def f1 [ +def f1 [ 1:num <- start-running f2 ] -def f2 [ +def f2 [ 12:num <- copy 44 ] +mem: storing 2 in location 1 @@ -362,7 +363,7 @@ def f2 [ % Routines.push_back(new routine(f2)); % Routines.back()->state = COMPLETED; // f2 not meant to run # must have at least one routine without escaping -def f3 [ +def f3 [ 3:num <- copy 0 ] # by interleaving '+' lines with '-' lines, we allow f1 and f3 to run in any order @@ -376,7 +377,7 @@ def f3 [ :(scenario scheduler_starts_at_middle_of_routines) % Routines.push_back(new routine(COPY)); % Routines.back()->state = COMPLETED; -def f1 [ +def f1 [ 1:num <- copy 0 2:num <- copy 0 ] @@ -388,12 +389,12 @@ def f1 [ :(scenario scheduler_terminates_routines_after_errors) % Hide_errors = true; % Scheduling_interval = 2; -def f1 [ +def f1 [ start-running f2 1:num <- copy 0 2:num <- copy 0 ] -def f2 [ +def f2 [ # divide by 0 twice 3:num <- divide-with-remainder 4, 0 4:num <- divide-with-remainder 4, 0 @@ -410,11 +411,11 @@ def f2 [ //:: Routines are marked completed when their parent completes. :(scenario scheduler_kills_orphans) -def main [ +def main [ start-running f1 # f1 never actually runs because its parent completes without waiting for it ] -def f1 [ +def f1 [ 1:num <- copy 0 ] -schedule: f1 @@ -442,13 +443,13 @@ def f1 [ :(scenario routine_state_test) % Scheduling_interval = 2; -def f1 [ +def f1 [ 1:num/child-id <- start-running f2 12:num <- copy 0 # race condition since we don't care about location 12 # thanks to Scheduling_interval, f2's one instruction runs in between here and completes 2:num/state <- routine-state 1:num/child-id ] -def f2 [ +def f2 [ 12:num <- copy 0 # trying to run a second instruction marks routine as completed ] @@ -536,16 +537,16 @@ put(Recipe_ordinal,:(scenario routine_discontinues_past_limit) % Scheduling_interval = 2; -def f1 [ +def f1 [ 1:num/child-id <- start-running f2 limit-time 1:num/child-id, 10 # padding loop just to make sure f2 has time to completed 2:num <- copy 20 2:num <- subtract 2:num, 1 - jump-if 2:num, -2:offset + jump-if 2:num, -2:offset ] -def f2 [ - jump -1:offset # run forever +def f2 [ + jump -1:offset # run forever $print [should never get here], 10/newline ] # f2 terminates @@ -660,14 +661,14 @@ put(Recipe_ordinal,} :(scenario number_of_instructions) -def f1 [ +def f1 [ 10:num/child-id <- start-running f2 { loop-unless 20:num } 11:num <- number-of-instructions 10:num ] -def f2 [ +def f2 [ # 2 instructions worth of work 1:num <- copy 34 20:num <- copy 1 @@ -678,14 +679,14 @@ def f2 [ :(scenario number_of_instructions_across_multiple_scheduling_intervals) % Scheduling_interval = 1; -def f1 [ +def f1 [ 10:num/child-id <- start-running f2 { loop-unless 20:num } 11:num <- number-of-instructions 10:num ] -def f2 [ +def f2 [ # 4 instructions worth of work 1:num <- copy 34 2:num <- copy 1 @@ -699,16 +700,16 @@ def f2 [ //:: make sure that each routine gets a different alloc to start :(scenario new_concurrent) -def f1 [ +def f1 [ start-running f2 - 1:&:num/raw <- new number:type + 1:&:num/raw <- new number:type # wait for f2 to complete { loop-unless 4:num/raw } ] -def f2 [ - 2:&:num/raw <- new number:type +def f2 [ + 2:&:num/raw <- new number:type # hack: assumes scheduler implementation 3:bool/raw <- equal 1:&:num/raw, 2:&:num/raw # signal f2 complete -- cgit 1.4.1-2-gfad0