• 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: Continue application processing with mouse down on a menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Continue application processing with mouse down on a menu


  • Subject: Re: Continue application processing with mouse down on a menu
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 26 Sep 2015 12:19:05 -0700

> On Sep 26, 2015, at 11:19 AM, Programmingkid <email@hidden> wrote:
>
> I just wish there were an easy way for the a task on the main thread to continue to work even if the user is looking at a menu. Using multiple threads has a lot of problems associated with it.

Well, it kind of goes without saying that if you want to do multiple independent tasks at the same time, you need multiple threads.

The event-loop-based model used by AppKit/UIKit is a way of taming some of the complexity of threads, by using a cooperative scheduling model for UI tasks. I’ve worked on GUI frameworks that allowed any thread to do anything at any time, and deadlocks and race conditions were constant problems.

But anyway, if you’ve got a main-thread task that does its work incrementally via a timer or whatnot, it can continue to work while a menu is active as long as you use the correct runloop mode.

—Jens
_______________________________________________

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: Continue application processing with mouse down on a menu
      • From: Programmingkid <email@hidden>
References: 
 >Continue application processing with mouse down on a menu (From: Programmingkid <email@hidden>)
 >Re: Continue application processing with mouse down on a menu (From: Jens Alfke <email@hidden>)
 >Re: Continue application processing with mouse down on a menu (From: Programmingkid <email@hidden>)
 >Re: Continue application processing with mouse down on a menu (From: Jens Alfke <email@hidden>)
 >Re: Continue application processing with mouse down on a menu (From: Programmingkid <email@hidden>)

  • Prev by Date: Re: Continue application processing with mouse down on a menu
  • Next by Date: Re: Continue application processing with mouse down on a menu
  • Previous by thread: Re: Continue application processing with mouse down on a menu
  • Next by thread: Re: Continue application processing with mouse down on a menu
  • Index(es):
    • Date
    • Thread