anchor.diff:  -include("ns_common.hrl").
   
   -export([start/1, start/2, start_many/2,
  +         perform/1, perform/2,
            abort/1, abort_many/1,
            send/2,
            with/2, with_many/3,
  
positive.code:     end.
  
  %% internal
  async_init(Parent, PDict, Fun) ->
      process_flag(trap_exit, true),
      MRef = erlang:monitor(process, Parent),
  
  
negative.code:             terminate_now(Reason, [Child | ChildAsyncs]);
          {'$async_req', From, {register_child_async, Pid}} ->
              reply(From, ok),
              async_loop_wait_result(Type, ParentMRef, Child,
                                     Reply, [Pid | ChildAsyncs]);
          {Reply, Result} ->
              async_loop_handle_result(Type, ParentMRef, Child, ChildAsyncs, Result);
          {'$async_msg', Msg} ->
              Child ! Msg,
              async_loop_wait_result(Type, ParentMRef, Child, Reply, ChildAsyncs)
      end.
  
  terminate_now(Reason, Children) ->
      misc:terminate_and_wait(Reason, Children),
      exit(Reason).
  
  terminate_on_query(perform, _ParentMRef, Reason, Children) ->
      terminate_now(Reason, Children);
  terminate_on_query(wait, ParentMRef, Reason, Children) ->
      misc:terminate_and_wait(Reason, Children),
      async_loop_with_result(ParentMRef, {die, Reason}).
  
  async_loop_handle_result(Type, ParentMRef, Child, ChildAsyncs, Result) ->
      unlink(Child),
      ?flush({'EXIT', Child, _}),
  
      misc:terminate_and_wait(shutdown, ChildAsyncs),
  
      case Type of
          perform ->
              case Result of
                  {raised, _} = Raised ->
                      exit(Raised);
                  {ok, _} ->
                      exit(normal)
              end;
          wait ->
              case Result of
                  {ok, Success} ->
                      async_loop_with_result(ParentMRef, {reply, Success});
                  {raised, _} = Raised ->
                      async_loop_with_result(ParentMRef, {die, Raised})
              end
      end.
  
  async_loop_with_result(ParentMRef, Result) ->
  