• 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: Do I need to use Distributed Objects or not?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do I need to use Distributed Objects or not?


  • Subject: Re: Do I need to use Distributed Objects or not?
  • From: Dave Camp <email@hidden>
  • Date: Wed, 9 Feb 2005 16:25:18 -0800

On Feb 9, 2005, at 10:23 AM, Evan Schoenberg wrote:

Dave,
The older Xcode 1.2 docs used to have some sample code in them for using a custom NSNotificationCenter and a NSMachPort to send NSNotifications between threads that would run at idle time, but that seems to have been removed in the latest docs. I've seen the same technique used by others as well. I can send you some source if you want.
I'd appreciate seeing this sample code, as well. Could it be linked on-list?

I've posted my lame code at:

<http://www.thinbits.com/ThreadNotification.zip>

It's based on the Apple sample which seems to not be available anymore. I've also seen similar code on one of the Cocoa dev sites, so at least I'm not the only one that thought it was useful. There are some development notes and suggestions in the source.

Essentially, you allocate one of the ThreadNotificationObjects on the thread that is to receive idle time notifications, and then post to that object from other threads.

[center postNotification:@"foo!" object:NULL];

If you have multiple threads to send objects to, just allocate more centers as needed...

Dave

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Do I need to use Distributed Objects or not? (From: Michael Becker <email@hidden>)
 >Re: Do I need to use Distributed Objects or not? (From: Dave Camp <email@hidden>)
 >Re: Do I need to use Distributed Objects or not? (From: Evan Schoenberg <email@hidden>)

  • Prev by Date: Re: Cocoa-dev Digest, Vol 2, Issue 192
  • Next by Date: RE: Connecting NSOutlineView to NSTextView
  • Previous by thread: Re: Do I need to use Distributed Objects or not?
  • Next by thread: Re: Do I need to use Distributed Objects or not?
  • Index(es):
    • Date
    • Thread