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