• 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: Threads, messages and blocking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threads, messages and blocking


  • Subject: Re: Threads, messages and blocking
  • From: Dave Camp <email@hidden>
  • Date: Thu, 29 May 2003 14:43:03 -0700

Look at:
<file:///Developer/Documentation/Cocoa/TasksAndConcepts/ ProgrammingTopics/Notifications/index.html>
and click on "Delivering Notifications to Particular Threads".

This section was added in one of the recent tool updates with a nice example of using a notification center and a mach port to send notifications to specific threads. I've found this much easier and more reliable than fiddling with DO. I implemented a subclass of NSNotificationCenter that handles all of this quite nicely.

Dave

On Thursday, May 29, 2003, at 01:27 PM, Sean Harding wrote:

I have an Objective-C Cocoa application with two threads (NSThread). I need
thread 1 to tell thread 2 to do something and to know when thread 2 is done
doing it. But thread 1 must not block while thread 2 carries out its work
(if blocking was ok, I wouldn't even need a second thread). It seems that
setting up an NSConnection between the threads (as demonstrated in the Apple
"Forming Connections Between Threads" document) won't solve my problem
because thread 1 will send the message to thread 2 and then block while the
work is carried out (until the called method returns). Right?

---
Among the chief weapons of UNIX: Fear, surprise and ruthless efficiency.
_______________________________________________
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: 
 >Threads, messages and blocking (From: Sean Harding <email@hidden>)

  • Prev by Date: NSScreen and NSCoptBits
  • Next by Date: Re: Threads, messages and blocking
  • Previous by thread: Threads, messages and blocking
  • Next by thread: Re: Threads, messages and blocking
  • Index(es):
    • Date
    • Thread