Re: [Q] Characteristics of different Inter Process Communication mechanism on Mac?
Re: [Q] Characteristics of different Inter Process Communication mechanism on Mac?
- Subject: Re: [Q] Characteristics of different Inter Process Communication mechanism on Mac?
- From: "Finlay Dobbie" <email@hidden>
- Date: Fri, 7 Sep 2007 13:01:16 +0100
On 07/09/07, JongAm Park <email@hidden> wrote:
> Hello.
>
> I became curious about IPC mechanisms on the Mac platform.
>
> Well.. there are at least 4 different type of IPC mechanism as far as I
> know.
>
> 1. AppleEvent
> 2. NSDistributedNotification
> 3. Remote Messaging
I believe the correct term you're looking for is "Distributed Objects".
> 4. Conventional IPC mechanisms based on socket/pipe/shared memory
5. Mach IPC
> I guess the method 4 is the basis of others.
> Although Apple pushes the AppleEvent for scriptable application, you can
> also use the mechanism for a simple IPC purpose, right? As far as I
> know, the AppleEvent was introduced as an IPC mechanism for the System 7.
>
> NS(Distributed)Notification mechanism seems to be widely used for
> Cocoa/Objective-C programmers nowadays. Like the AppleEvent, I guess it
> is processed through a central queue.
> Probably there are pros and cons because of the fact.
NSDistributedNotification has a lot of restrictions - it's basically
one-way, it has a fairly high overhead (it's processing through a
central queue in a server), you have to serialise everything to a
property list. But it's very easy and straightforward for simple
event-like notifications between apps.
> However, are there any special use cases where one method is preferred
> to others?
I don't really know that it's possible to draw any massive
conclusions. Distributed Notifications and DO have a higher overhead
(and DO requires you to use Foundation), AppleEvents are useful for
scripting and legacy Carbon code but probably unnecessarily fiddly
compared to "modern" alternatives, sockets and pipes are compatible
with other operating systems, and Mach messaging can be very fast and
flexible.
It really depends on what technologies your processes are implemented
in, what they need to be compatible with, how often you'll be sending
messages, how much data you want to shift between them, etc.
-- Finlay
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden