diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-25 22:27:19 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-25 22:27:19 -0700 |
commit | c5ffb6e1cc9c5ff880d037c53b8ebc8562be0008 (patch) | |
tree | 2d05d987ec3c81bfbb0c1f598966d9d1b16e9b1f /html/039wait.cc.html | |
parent | b2757892d553352feb59d70b1e7241ccdafa6905 (diff) | |
download | mu-c5ffb6e1cc9c5ff880d037c53b8ebc8562be0008.tar.gz |
1459
Diffstat (limited to 'html/039wait.cc.html')
-rw-r--r-- | html/039wait.cc.html | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/html/039wait.cc.html b/html/039wait.cc.html index 687cd207..9a07beae 100644 --- a/html/039wait.cc.html +++ b/html/039wait.cc.html @@ -2,7 +2,7 @@ <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> -<title>~/Desktop/s/mu/039wait.cc</title> +<title>039wait.cc</title> <meta name="Generator" content="Vim/7.4"> <meta name="plugin-version" content="vim7.4_v1"> <meta name="syntax" content="cpp"> @@ -57,7 +57,7 @@ recipe f2 [ WAITING<span class="Delimiter">,</span> <span class="Delimiter">:(before "End routine Fields")</span> <span class="Comment">// only if state == WAITING</span> -index_t waiting_on_location<span class="Delimiter">;</span> +long long int waiting_on_location<span class="Delimiter">;</span> int old_value_of_waiting_location<span class="Delimiter">;</span> <span class="Delimiter">:(before "End routine Constructor")</span> waiting_on_location = old_value_of_waiting_location = <span class="Constant">0</span><span class="Delimiter">;</span> @@ -74,7 +74,7 @@ case WAIT_FOR_LOCATION: <span class="Delimiter">{</span> Current_routine<span class="Delimiter">-></span>state = WAITING<span class="Delimiter">;</span> Current_routine<span class="Delimiter">-></span>waiting_on_location = loc<span class="Delimiter">.</span>value<span class="Delimiter">;</span> Current_routine<span class="Delimiter">-></span>old_value_of_waiting_location = Memory[loc<span class="Delimiter">.</span>value]<span class="Delimiter">;</span> - trace<span class="Delimiter">(</span><span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"waiting for location "</span> << loc<span class="Delimiter">.</span>value << <span class="Constant">" to change from "</span> << Memory[loc<span class="Delimiter">.</span>value]<span class="Delimiter">;</span> + trace<span class="Delimiter">(</span>Primitive_recipe_depth<span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"waiting for location "</span> << loc<span class="Delimiter">.</span>value << <span class="Constant">" to change from "</span> << Memory[loc<span class="Delimiter">.</span>value]<span class="Delimiter">;</span> <span class="CommentedCode">//? trace("schedule") << Current_routine->id << ": waiting for location " << loc.value << " to change from " << Memory[loc.value]; //? 2</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -82,7 +82,7 @@ case WAIT_FOR_LOCATION: <span class="Delimiter">{</span> <span class="Comment">//: scheduler tweak to get routines out of that state</span> <span class="Delimiter">:(before "End Scheduler State Transitions")</span> -for <span class="Delimiter">(</span>index_t i = <span class="Constant">0</span><span class="Delimiter">;</span> i < Routines<span class="Delimiter">.</span>size<span class="Delimiter">();</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +for <span class="Delimiter">(</span>long long int i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>Routines<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="CommentedCode">//? trace("schedule") << "wake up loop 1: routine " << Routines.at(i)->id << " has state " << Routines.at(i)->state; //? 1</span> if <span class="Delimiter">(</span>Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)-></span>state != WAITING<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="CommentedCode">//? trace("schedule") << "waiting on location: " << Routines.at(i)->waiting_on_location; //? 1</span> @@ -120,7 +120,7 @@ recipe f2 [ <span class="Delimiter">:(before "End routine Fields")</span> <span class="Comment">// only if state == WAITING</span> -index_t waiting_on_routine<span class="Delimiter">;</span> +long long int waiting_on_routine<span class="Delimiter">;</span> <span class="Delimiter">:(before "End routine Constructor")</span> waiting_on_routine = <span class="Constant">0</span><span class="Delimiter">;</span> @@ -131,9 +131,9 @@ Recipe_number[<span class="Constant">"wait-for-routine"</span>] = WAIT <span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> case WAIT_FOR_ROUTINE: <span class="Delimiter">{</span> Current_routine<span class="Delimiter">-></span>state = WAITING<span class="Delimiter">;</span> - assert<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>size<span class="Delimiter">()</span> == <span class="Constant">1</span><span class="Delimiter">);</span> <span class="Comment">// scalar</span> + assert<span class="Delimiter">(</span>scalar<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)));</span> Current_routine<span class="Delimiter">-></span>waiting_on_routine = ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> - trace<span class="Delimiter">(</span><span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"waiting for routine "</span> << ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> + trace<span class="Delimiter">(</span>Primitive_recipe_depth<span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"waiting for routine "</span> << ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -141,12 +141,12 @@ case WAIT_FOR_ROUTINE: <span class="Delimiter">{</span> <span class="Comment">// Wake up any routines waiting for other routines to go to sleep.</span> <span class="Comment">// Important: this must come after the scheduler loop above giving routines</span> <span class="Comment">// waiting for locations to change a chance to wake up.</span> -for <span class="Delimiter">(</span>index_t i = <span class="Constant">0</span><span class="Delimiter">;</span> i < Routines<span class="Delimiter">.</span>size<span class="Delimiter">();</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +for <span class="Delimiter">(</span>long long int i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>Routines<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> if <span class="Delimiter">(</span>Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)-></span>state != WAITING<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> if <span class="Delimiter">(</span>!Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)-></span>waiting_on_routine<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> - index_t id = Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)-></span>waiting_on_routine<span class="Delimiter">;</span> + long long int id = Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)-></span>waiting_on_routine<span class="Delimiter">;</span> assert<span class="Delimiter">(</span>id != Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)-></span>id<span class="Delimiter">);</span> - for <span class="Delimiter">(</span>index_t j = <span class="Constant">0</span><span class="Delimiter">;</span> j < Routines<span class="Delimiter">.</span>size<span class="Delimiter">();</span> ++j<span class="Delimiter">)</span> <span class="Delimiter">{</span> + for <span class="Delimiter">(</span>long long int j = <span class="Constant">0</span><span class="Delimiter">;</span> j < SIZE<span class="Delimiter">(</span>Routines<span class="Delimiter">);</span> ++j<span class="Delimiter">)</span> <span class="Delimiter">{</span> if <span class="Delimiter">(</span>Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>j<span class="Delimiter">)-></span>id == id && Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>j<span class="Delimiter">)-></span>state != RUNNING<span class="Delimiter">)</span> <span class="Delimiter">{</span> trace<span class="Delimiter">(</span><span class="Constant">"schedule"</span><span class="Delimiter">)</span> << <span class="Constant">"waking up routine "</span> << Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)-></span>id<span class="Delimiter">;</span> Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)-></span>state = RUNNING<span class="Delimiter">;</span> @@ -161,7 +161,7 @@ SWITCH<span class="Delimiter">,</span> Recipe_number[<span class="Constant">"switch"</span>] = SWITCH<span class="Delimiter">;</span> <span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> case SWITCH: <span class="Delimiter">{</span> - index_t id = some_other_running_routine<span class="Delimiter">();</span> + long long int id = some_other_running_routine<span class="Delimiter">();</span> if <span class="Delimiter">(</span>id<span class="Delimiter">)</span> <span class="Delimiter">{</span> assert<span class="Delimiter">(</span>id != Current_routine<span class="Delimiter">-></span>id<span class="Delimiter">);</span> <span class="CommentedCode">//? cerr << "waiting on " << id << " from " << Current_routine->id << '\n'; //? 1</span> @@ -172,8 +172,8 @@ case SWITCH: <span class="Delimiter">{</span> <span class="Delimiter">}</span> <span class="Delimiter">:(code)</span> -index_t some_other_running_routine<span class="Delimiter">()</span> <span class="Delimiter">{</span> - for <span class="Delimiter">(</span>index_t i = <span class="Constant">0</span><span class="Delimiter">;</span> i < Routines<span class="Delimiter">.</span>size<span class="Delimiter">();</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +long long int some_other_running_routine<span class="Delimiter">()</span> <span class="Delimiter">{</span> + for <span class="Delimiter">(</span>long long int i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>Routines<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> if <span class="Delimiter">(</span>i == Current_routine_index<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> assert<span class="Delimiter">(</span>Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> != Current_routine<span class="Delimiter">);</span> assert<span class="Delimiter">(</span>Routines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)-></span>id != Current_routine<span class="Delimiter">-></span>id<span class="Delimiter">);</span> |