RE: Questions about NSDistributedNotificationCenter
RE: Questions about NSDistributedNotificationCenter
- Subject: RE: Questions about NSDistributedNotificationCenter
- From: "Tony" <email@hidden>
- Date: Sun, 29 Jul 2001 21:21:42 -0400
-----Original Message-----
>
From: Lloyd Sargent <email@hidden>
>
Subject: Questions about NSDistributedNotificationCenter
>
Got a couple of quick questions about NSDistributedNotificationCenter:
>
1. Is this the "normal" method of passing simple "messages" between
>
threads?
I have noticed that these notifications are picked up by the run loop in
the main thread but would not be picked up by the run loops in secondary
threads.
In other words, if you create Obj-C object that runs default thread run loop
in detached thread selector parameter (which is one of object's methods) and
which also subscribes to NSDistributedNotificationCenter notifications, it
will never get them.
Run loop in the main thread has no such problems.
So, rather than answering your questions I'm afraid I must add that this is
not well documented. Distributed notification center can be used for
inter-process communication (several of us actually use it for IPC and
synchronization and proper timeouts are the major hurdles that we
encountered) but for in-process intra-thread communication local
notification center should be sufficient. Threading rules and affinities are
unknown at this time.
Tony