• 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: Worker threads and UI threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Worker threads and UI threads


  • Subject: Re: Worker threads and UI threads
  • From: Vince DeMarco <email@hidden>
  • Date: Thu, 6 Jun 2002 22:02:37 -0700

On Thursday, June 6, 2002, at 08:44 PM, Cryx wrote:

On Thursday, June 6, 2002, at 10:03 PM, Chris DeSalvo wrote:
Does anyone know of some working sample code that has a working thread
posting messages to the main app thread so that the main thread can update
UI?

You'll probably be better off using distributed objects. Take a look at the SimpleThreads sample code on the developer site. DOs seem to me to be a bit heavyweight for interthread communication, but it's the most reliable way to communicate with the AppKit from a subthread.


For a lighter weight solution you could use CFMessage and CFMessagePort. its not as easy as DO but its much lighter wight.

Set up a CFMessagePort and a handler function in the main thread then have the secondary thread send a CFMessage to the main ui thread and get it to do something like update the ui etc..

vince
_______________________________________________
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: Worker threads and UI threads
      • From: Cryx <email@hidden>
References: 
 >Re: Worker threads and UI threads (From: Cryx <email@hidden>)

  • Prev by Date: Re: Worker threads and UI threads
  • Next by Date: Re: Worker threads and UI threads
  • Previous by thread: Re: Worker threads and UI threads
  • Next by thread: Re: Worker threads and UI threads
  • Index(es):
    • Date
    • Thread