• 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: [Q] Why is the threading and UI updating designed to be done only on a main thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?


  • Subject: Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?
  • From: Wade Tregaskis <email@hidden>
  • Date: Wed, 14 Mar 2012 09:19:18 -0700

> Threads themselves are very useful; multiple threads taking user input and updating the display to the user are not really useful, and the request for them more often than not betrays a lack of understanding of threading.

So you think it'd be great it every GUI app shared the same serial queue for all interactivity and drawing?  Boy do I have a Mac Classic to sell you...

The reality is of course more of a compromise.  It's quite common to do drawing across multiple threads, though you still synchronise the final "blits" around a single thread (i.e. the main thread).  Likewise even event handling is often effectively multi-threaded, because you dispatch from the main thread to a variety of tasks, queues or worker threads.

Having a UI framework that either offloads some of this for you can actually be very useful.  It would also be closer to the user experience we're trying to portray - for example, that each document on an app is totally independent.  Having all documents hang because one is having issues (Safari I'm looking at you, you evil bastard) completely breaks that illusion.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?
      • From: JongAm Park <email@hidden>
    • Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?
      • From: Per Bull Holmen <email@hidden>
References: 
 >[Q] Why is the threading and UI updating designed to be done only on a main thread? (From: JongAm Park <email@hidden>)
 >Re: [Q] Why is the threading and UI updating designed to be done only on a main thread? (From: Scott Ribe <email@hidden>)
 >Re: [Q] Why is the threading and UI updating designed to be done only on a main thread? (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?
  • Next by Date: Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?
  • Previous by thread: Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?
  • Next by thread: Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?
  • Index(es):
    • Date
    • Thread