ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/MP.pm
(Generate patch)

Comparing AnyEvent-MP/MP.pm (file contents):
Revision 1.50 by root, Fri Aug 14 14:01:05 2009 UTC vs.
Revision 1.51 by root, Fri Aug 14 14:07:44 2009 UTC

738convenience functionality. 738convenience functionality.
739 739
740This means that AEMP requires a less tightly controlled environment at the 740This means that AEMP requires a less tightly controlled environment at the
741cost of longer node references and a slightly higher management overhead. 741cost of longer node references and a slightly higher management overhead.
742 742
743=item Erlang has a "remote ports are like local ports" philosophy, AEMP
744uses "local ports are like remote ports".
745
746The failure modes for local ports are quite different (runtime errors
747only) then for remote ports - when a local port dies, you I<know> it dies,
748when a connection to another node dies, you know nothing about the other
749port.
750
751Erlang pretends remote ports are as reliable as local ports, even when
752they are not.
753
754AEMP encourages a "treat remote ports differently" philosophy, with local
755ports being the special case/exception, where transport errors cannot
756occur.
757
743=item * Erlang uses processes and a mailbox, AEMP does not queue. 758=item * Erlang uses processes and a mailbox, AEMP does not queue.
744 759
745Erlang uses processes that selctively receive messages, and therefore 760Erlang uses processes that selectively receive messages, and therefore
746needs a queue. AEMP is event based, queuing messages would serve no useful 761needs a queue. AEMP is event based, queuing messages would serve no
747purpose. 762useful purpose. For the same reason the pattern-matching abilities of
763AnyEvent::MP are more limited, as there is little need to be able to
764filter messages without dequeing them.
748 765
749(But see L<Coro::MP> for a more Erlang-like process model on top of AEMP). 766(But see L<Coro::MP> for a more Erlang-like process model on top of AEMP).
750 767
751=item * Erlang sends are synchronous, AEMP sends are asynchronous. 768=item * Erlang sends are synchronous, AEMP sends are asynchronous.
752 769
753Sending messages in Erlang is synchronous and blocks the process. AEMP 770Sending messages in Erlang is synchronous and blocks the process (and
754sends are immediate, connection establishment is handled in the 771so does not need a queue that can overflow). AEMP sends are immediate,
755background. 772connection establishment is handled in the background.
756 773
757=item * Erlang can silently lose messages, AEMP cannot. 774=item * Erlang suffers from silent message loss, AEMP does not.
758 775
759Erlang makes few guarantees on messages delivery - messages can get lost 776Erlang makes few guarantees on messages delivery - messages can get lost
760without any of the processes realising it (i.e. you send messages a, b, 777without any of the processes realising it (i.e. you send messages a, b,
761and c, and the other side only receives messages a and c). 778and c, and the other side only receives messages a and c).
762 779
774eventually be killed - it cannot happen that a node detects a port as dead 791eventually be killed - it cannot happen that a node detects a port as dead
775and then later sends messages to it, finding it is still alive. 792and then later sends messages to it, finding it is still alive.
776 793
777=item * Erlang can send messages to the wrong port, AEMP does not. 794=item * Erlang can send messages to the wrong port, AEMP does not.
778 795
779In Erlang it is quite possible that a node that restarts reuses a process 796In Erlang it is quite likely that a node that restarts reuses a process ID
780ID known to other nodes for a completely different process, causing 797known to other nodes for a completely different process, causing messages
781messages destined for that process to end up in an unrelated process. 798destined for that process to end up in an unrelated process.
782 799
783AEMP never reuses port IDs, so old messages or old port IDs floating 800AEMP never reuses port IDs, so old messages or old port IDs floating
784around in the network will not be sent to an unrelated port. 801around in the network will not be sent to an unrelated port.
785 802
786=item * Erlang uses unprotected connections, AEMP uses secure 803=item * Erlang uses unprotected connections, AEMP uses secure

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines