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

Re: Child threads and the UI


  • Subject: Re: Child threads and the UI
  • From: Chris Gehlker <email@hidden>
  • Date: Wed, 24 Oct 2001 11:45:26 -0700

On 10/23/01 3:03 PM, "Peter Ammon" <email@hidden> wrote:

> On Monday, October 22, 2001, at 04:09 PM, Chris Gehlker wrote:
>
>> I'm working on a program that does cel animation. Building a Movie can
>> take
>> awhile and I want to show a progress bar while the program is looping
>> through frames. Looking through the archives of this list, I found that
>> the
>> canonical approach is to launch a thread to do the animation and to use
>> DO
>> to report progress back to the main thread which runs the progress bar.
>> The
>> canonical way works.
>>
>> But it also seems to work if I just let the daughter thread own the
>> NSProgressIndicator and the NSPanel that it's displayed in. This also
>> seems
>> like cleaner code because none of the methods in the main thread need to
>> know anything about the progress bar.
>>
>> I'm just worried that I may be setting myself up for a fall by going
>> down
>> this path. Am I missing something?
>
> What happens if you attempt to update the status of the
> NSProgressIndicator while it is in its display: method? Bad stuff could
> happen.

It doesn't seem too, but, thanks to you and those who responded privately
I'm convinced that I just happened to stumble on a thread-safe piece of
AppKit. I've gone back to letting the primary thread handle everything in
the UI.

--
Cogito Ergo Spud. - I think therefore I yam.


References: 
 >Re: Child threads and the UI (From: Peter Ammon <email@hidden>)

  • Prev by Date: Re: NSOutlineView Table Column Clicks
  • Next by Date: Wrapping conventional .a libraries in a framework...
  • Previous by thread: Re: Child threads and the UI
  • Next by thread: Re: Child threads and the UI
  • Index(es):
    • Date
    • Thread