anchor.diff:          unchanged -> S1
       end;
   
  +on({check_delayed_del_watching_of, WatchedPid, Time} = _Msg, State) ->
  +    ?TRACE("fd_hbs check_delayed_del_watching_of ~.0p~n", [_Msg]),
  +    %% initiate demonitoring and delete local entry if
  +    %% entry time is still unmodified since this message was triggered
  +    RemPids = state_get_rem_pids(State),
  +    case lists:keyfind(WatchedPid, 1, RemPids) of
  +        false -> log:log(error, "req. to delete non watched pid~n"),
  +                 State;
  +        Entry ->
  +            NewRemPids =
  +                case rempid_get_last_modified(Entry) of
  +                    Time -> %% untouched for whole wait period
  +                        RemHBS = state_get_rem_hbs(State),
  +                        case comm:make_local(RemHBS) of
  +                            fd -> comm:send(RemHBS, {del_watching_of_via_fd, comm:this(), WatchedPid});
  +                            _ -> comm:send(RemHBS, {del_watching_of, WatchedPid})
  +                        end,
  +                        lists:delete(WatchedPid, RemPids);
  +                    _ ->
  +                        NewEntry =
  +                            case rempid_refcount(Entry) of
  +                                0 -> %% retrigger delayed del watching
  +                                    NewTime = os:timestamp(),
  +                                    msg_delay:send_local(
  +                                      1, self(),
  +                                      {check_delayed_del_watching_of,
  +                                       WatchedPid, NewTime}),
  +                                    rempid_set_last_modified(Entry, NewTime);
  +                                _ ->
  +                                    rempid_set_pending_demonitor(Entry, false)
  +                            end,
  +                        lists:keyreplace(WatchedPid, 1, RemPids, NewEntry)
  +                end,
  +            state_set_rem_pids(State, NewRemPids)
  +    end;
  +
   on({add_watching_of, WatchedPid} = _Msg, State) ->
       ?TRACE("fd_hbs add_watching_of ~.0p~n", [_Msg]),
       %% request from remote fd_hbs: watch a pid locally and forward
  
positive.code: -include("scalaris.hrl").
  
  -export([init/1, on/2, start_link/2, check_config/0]).
  -type(state() :: {
         comm:mypid(),   %% remote hbs
         [{comm:mypid(), pos_integer()}], %% subscribed rem. pids + ref counting
         util:time(),    %% local time of last pong arrival
         util:time(),    %% remote is crashed if no pong arrives until this
         atom(),         %% ets table name
         %% locally monitored pids for a remote hbs:
         [{comm:mypid(), reference()}]
       }).
  
  
negative.code:                 _ -> comm:send(RemHBS, {add_watching_of, WatchedPid})
              end,
              %% add to list
              state_set_rem_pids(
                State, [rempid_inc(rempid_new(WatchedPid)) | RemPids]);
          Entry ->
              NewEntry = rempid_inc(Entry),
              state_set_rem_pids(
                State, lists:keyreplace(WatchedPid, 1, RemPids, NewEntry))
      end.
  