anchor.diff:  handle_call(bytes, _From, #file{fd = Fd} = File) ->
       {reply, file:position(Fd, eof), File};
   
  -handle_call({set_db_pid, Pid}, _From, #file{db_pid=OldPid}=File) ->
  -    case is_pid(OldPid) of
  -        true -> unlink(OldPid);
  +handle_call({set_db_pid, Pid}, _From, #file{db_monitor=OldRef}=File) ->
  +    case is_reference(OldRef) of
  +        true -> demonitor(OldRef, [flush]);
           false -> ok
       end,
  -    link(Pid),
  -    {reply, ok, File#file{db_pid=Pid}};
  +    Ref = monitor(process, Pid),
  +    {reply, ok, File#file{db_monitor=Ref}};
   
   handle_call(sync, _From, #file{fd=Fd}=File) ->
       {reply, file:sync(Fd), File};
  
positive.code:     fd,
      is_sys,
      eof = 0,
      db_pid,
      pread_limit = 0
  }).
  
  
negative.code: -define(MONITOR_CHECK, 10000).
  -define(SIZE_BLOCK, 16#1000). % 4 KiB
  -define(READ_AHEAD, 2 * ?SIZE_BLOCK).
  -define(IS_OLD_STATE(S), is_pid(S#file.db_monitor)).
  -define(PREFIX_SIZE, 5).
  -define(DEFAULT_READ_COUNT, 1024).
  
  