Wrapping my head around pthreads, nsthreads, and nsnotificationcenter
Wrapping my head around pthreads, nsthreads, and nsnotificationcenter
- Subject: Wrapping my head around pthreads, nsthreads, and nsnotificationcenter
- From: "Ian Archer" <email@hidden>
- Date: Fri, 2 Nov 2007 15:28:58 -0400
I have an app that needs to remain portable across windows and unix,
although I'm trying to put Cocoa in whenever I can on the mac side.
pthreads are prevalent, although mac-specific stuff is all done in nsthread.
Much of the mac code relies on NSNotificationCenter. I'm finding that
one of my objects is not receiving messages from the center (or, in
some cases, receives the first and receives no more).
I guessed this was due to either 1) NSNotificationCenter's thread
separation (e.g. messages can only be received on the thread from
which they are sent), or 2) some weird incompatibility between pthread
and nsthread.
In the object "A" which should be receiving messages but isn't, I
added a thread startup in its init method which basically does nothing
except spin and sleep. Now, this object is receiving messages from
the notificaton center! Does anyone know what might be causing this
strange behavior?
_______________________________________________
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