• 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: Rainer Brockerhoff <email@hidden>
  • Date: Thu, 25 Oct 2001 09:04:06 -0200

Date: Wed, 24 Oct 2001 11:45:26 -0700
From: Chris Gehlker <email@hidden>

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

> 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.

I'm doing multithreaded UI without any "bad stuff" so far by:
- starting new threads with [NSApplication detachDrawingThread:toTarget:withObject:];
- making sure only one single thread updates a given view.

In one single case I have a popup button which may be accessed by two threads, I'm bracketing all accesses of the button with lockFocusIfCanDraw and unlockFocus calls - which seems to successfully avoid problems.

YMMV,

--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"Originality is the art of concealing your sources."
http://www.brockerhoff.net/ (updated Oct. 2001)


  • Prev by Date: RE: Hiding a view
  • Next by Date: Re: Hiding a view
  • Previous by thread: Re: Child threads and the UI
  • Next by thread: server no workee?
  • Index(es):
    • Date
    • Thread