• 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
Re: NSMachPort thread safety
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMachPort thread safety


  • Subject: Re: NSMachPort thread safety
  • From: "Kyle Sluder" <email@hidden>
  • Date: Sat, 1 Mar 2008 23:35:52 -0500

On Sat, Mar 1, 2008 at 9:01 PM, Adam R. Maxwell <email@hidden> wrote:
>  Thanks, but I think you're misinterpreting the example :).  The object
>  has a single NSMachPort ivar, added to the some thread's runloop.
>  When a notification arrives on a different thread in
>  processNotification:, it messages the NSMachPort.  When the port's
>  delegate receives handleMachMessage: it processes the notification
>  since it's guaranteed to be on the correct thread.

Okay, so I don't understand where the problem is.  The reason for the
locking and thread-checking is so that two threads can share the
non-thread-safe NSPort object.  Unless when I said "messages" you were
thinking in Mach port terms; I meant you can't send an Objective-C
message from thread A to a non-thread-safe object on thread B (unless,
of course, you implement the locking yourself).

--Kyle Sluder
_______________________________________________

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: NSMachPort thread safety
      • From: "Adam R. Maxwell" <email@hidden>
References: 
 >NSMachPort thread safety (From: "Adam R. Maxwell" <email@hidden>)
 >Re: NSMachPort thread safety (From: "Kyle Sluder" <email@hidden>)
 >Re: NSMachPort thread safety (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: Re: Unread count for items in Mail.app-styled NSOutlineView
  • Next by Date: Re: NSMachPort thread safety
  • Previous by thread: Re: NSMachPort thread safety
  • Next by thread: Re: NSMachPort thread safety
  • Index(es):
    • Date
    • Thread