• 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: Sean Harding <email@hidden>
  • Date: Thu, 29 May 2003 15:26:39 -0700

On Thu May 29 at 11:07:57 PM, Tom Sutcliffe wrote:

> Short answer: in the second thread, you probably want to call
> NSObject's performSelectorOnMainThread.
>
> Long answer: It depends on what work you want thread 1 to be able to do
> while thread 2 is running, and what thread 1 actually is. If it is the
> main application thread, then you use performSelectorOnMainThread,
> which is Cocoa's way of doing callbacks. Thread 1 can continue to run

Yes, thread 1 is the main application thread. performSelectorOnMainThread
looks like it could help. But I'm not sure it will completely solve the
problem. Sometimes I'll have thread 2 idle while thread 1 does unrelated
stuff, and then thread 1 will need it to do something.
performSelectorOnMainThread only allows communication thread 2->thread 1
(main thread), it appears. So it doesn't give me any way to have the main
thread send thread 2 another "go to work" message. Am I misunderstanding the
suggestion?

Thanks.

sean

--
Sean Harding -- email@hidden -- http://dogcow.org/s/ -- KD7UAY
Seattle, WA, USA
_______________________________________________
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.

  • Follow-Ups:
    • Re: Threads, messages and blocking
      • From: Chris Hanson <email@hidden>
    • Re: Threads, messages and blocking
      • From: Drew McCormack <email@hidden>
    • Re: Threads, messages and blocking
      • From: Dustin Voss <email@hidden>
References: 
 >Threads, messages and blocking (From: Sean Harding <email@hidden>)
 >Re: Threads, messages and blocking (From: Tom Sutcliffe <email@hidden>)

  • Prev by Date: Re: NEWBIE: Advice on Starting Out
  • Next by Date: Re: color
  • Previous by thread: Re: Threads, messages and blocking
  • Next by thread: Re: Threads, messages and blocking
  • Index(es):
    • Date
    • Thread