• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Wrapping my head around pthreads, nsthreads, and nsnotificationcenter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Wrapping my head around pthreads, nsthreads, and nsnotificationcenter
      • From: Chris Kane <email@hidden>
  • Prev by Date: Re: Garbage collection, core data, and tight loops
  • Next by Date: [Leopard] Interface Builder - Subclassing
  • Previous by thread: Re: Garbage collection, core data, and tight loops
  • Next by thread: Re: Wrapping my head around pthreads, nsthreads, and nsnotificationcenter
  • Index(es):
    • Date
    • Thread