• 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: Cocoa really needs to be thread-safe (Dave Rehring)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa really needs to be thread-safe (Dave Rehring)


  • Subject: Re: Cocoa really needs to be thread-safe (Dave Rehring)
  • From: Richard Kendall Wolf <email@hidden>
  • Date: Sat, 2 Nov 2002 01:26:19 -0600

A very simple way to make this hack break down completely is to hold
down a button while events from other threads are being posted to the
main thread. NSSounds stop playing (they're played by the main thread,
apparently), events start welling up and aren't answered (main thread
is busy serving the button click, apparently),

Steve, I must be missing something.

It sounds like you want your main thread to be doing something while the user is occupying it synchronously (that is, you want a thread to be doing two things at once -- track the button click and respond to events). Could you lay out why a design change in your code couldn't fix the problem? I'm not saying you're wrong ... just that I'm not understanding.

Basically, I always look at a multithreaded application this way:

1. Your user interface only handles user interface stuff. If the user wants the be synchronous, that's cool, because you're other threads are taking care of that.

2. Your other threads handle the processing you want to do. Sometimes the user interface tells them to do things, sometimes they hang out and wait for the user interface to listen to them.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: Re: Are polymorphic objects possible?
  • Next by Date: Java vs Objective-C security
  • Previous by thread: Re: Are polymorphic objects possible?
  • Next by thread: Java vs Objective-C security
  • Index(es):
    • Date
    • Thread