• 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: How to send message between thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to send message between thread?


  • Subject: Re: How to send message between thread?
  • From: Nathan Day <email@hidden>
  • Date: Fri, 22 Mar 2002 22:34:58 +1030

On Friday, March 22, 2002, at 01:50 AM, email@hidden wrote:

I find several ways to send messages, but have some question about them.
1. NSPortMessage:
I may set delegate for the send port and implement handlePortMessage: to do things upon the message in main thread. I wonder when there's large amount of message within short time, will this works well?

I've done this, if you try to send more messages than the NSRunLoop can handle, it will buffer a very small number, then your sending thread will just wait. You can look at what I did at my iTools site http://homepage.mac.com/nathan_day/

3. NSNotification:
I'm afraid this solution is not good for large amount of message within short time. I wonder if the notification may be lost or be processed very slow when there's too much messages. I also think this may not absolutely thread safe.

NSNotificationCenter isn't thread safe but NSDistributedNotificationCenter is.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >How to send message between thread? (From: email@hidden)

  • Prev by Date: Inputting data to a drawRect function
  • Next by Date: looking for a developer
  • Previous by thread: How to send message between thread?
  • Next by thread: NSStatusItem
  • Index(es):
    • Date
    • Thread