anchor.diff:  %%% Process Functionality
   %%% ==========================================================================
   %%% Note that we utilize the built in process 'notes' field, which is used to
  -%%% store scheduler information. We set this to true if it's been marked as a 
  +%%% store scheduler information. We set this to true if it's been marked as a
   %%% communication bound thread.
   
   %% @private
  
positive.code:     case T of
          nil ->
              setCurThread( Process, State );
          _   -> 
              {ok, NewState} = enqueue1( T, State ), % New process takes over
              setCurThread( Process, NewState )
      end.
  
  
  %% @private
  %% @doc Returns the top process in the primary ready queue. It uses the 
  %%   secondary queue if there it's primary is empty. This will not set the
  %%   returned process as the current thread.
  %% @end
  -spec dequeue1( #state{} ) -> false | {ok, #process{}, #state{}}.
  dequeue1( #state{ rdyQ1=Q1 } = State ) ->
      case queue:out( Q1 ) of 
          {empty,_} -> dequeue2( State );
          {{value, Top}, NewQ1} -> {ok, Top, State#state{rdyQ1=NewQ1}}
      end.
  
negative.code: %% @doc Cleanup is simple too, we ignore unfinised processes in the queue.
  cleanup( _State ) -> ok.
  
  %% @doc If we have hit the end of our reductions, pick the next process and
  %%   run one reduction before returning. We can ignore the message queue
  %%   as there are no other scheduler's to communicate with.
  %% @end
  tick( _Status, #state{ curReduct=0 }=State ) ->
      {ok, NState} =  pick_next( State ),
      reduce( NState );
  tick( _, State ) -> reduce( State ).
  
  %% @doc Spawn a process. This is called on the local scheduling thread, to
  %%   replace the currently running thread. The current process is enqueued.
  %% @end
  spawn_process( Process, State ) -> enqueueAndSwitchCurThread( Process, State ).
  