anchor.diff:                    mapper,
                     fn,
                     n_pending=0,
  -                  pending=[],
  +                  pending=sets:new(),
                     n_done=0,
                     done=[],
                     max_concurrent=1
  
positive.code:                                        fn=Fun,
                                         max_concurrent=MaxP},
                               List),
      % Collect pending work
      Collect =
          fun(Pid, Acc) ->
                  receive
                      {pmap_result, Pid, R} ->
                          [R|Acc]
                  end
          end,
      All = lists:foldl(Collect, Done, Pending),
      % Restore input order
      Sorted = lists:keysort(1, All),
      [ R || {_, R} <- Sorted ].
  
negative.code:                            R = Fn(X),
                             Mapper ! {pmap_result, self(), {NP+ND, R}}
                     end),
      Acc#pmap_acc{n_pending=NP+1, pending=sets:add_element(Worker, Pending)};
  pmap_worker(X, Acc = #pmap_acc{n_pending=NP,
                                 pending=Pending,
                                 n_done=ND,
  