Re: Worker threads and UI threads
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.