• 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: multithreaded vs ...?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multithreaded vs ...?


  • Subject: Re: multithreaded vs ...?
  • From: email@hidden
  • Date: Mon, 18 Feb 2002 11:15:08 -0800

i wasn't trying to imply that Swing was threadsafe. I was merely suggesting that the java language constructs for synchronized methods and monitor handling are easier for me to use than the suggestions of using DO in Cocoa. Imagine if you had to use RMI to get messages between threads in Java?

any further discussion of java vs. cocoa should please be taken offline... or better yet, dropped... i'm sorry i mentioned it.

the topic really is, writing multi-threaded cocoa apps is far harder and more obfuscated (DO?) than it ought to be.

threaded code ought to be able to message the main runloop and have it call back in a threadsafe context for drawing. it's fine if the underlying code uses DO or mach message ports, but the api ought to hide all of that, just like NSFileHandle readInBackgroundAndNotify hides the select().

Something like performSelector, but performSelectorFromYourRunloopInYourThread...


On Monday, February 18, 2002, at 10:11 AM, Raphael Sebbe wrote:

Not sure about that. I had to access GUI in a Swing program from a secondary, native thread (through JNI) and THAT is what I call a mess. You have the same problems as Cocoa when using Swing (or other GUI libs), and the solution I could find after searching a lot was to use immediate swing timers (those are fired from the main thread)...

At least Cocoa provides several documented mechanism for doing that.

Raphael

ps: if you know of simple Java interthread comm (in particular with the Swing drawing thread), I'm still interested !

On Monday, February 18, 2002, at 06:01 PM, email@hidden wrote:


Using threads in Cocoa is an over-complex obfuscated mess. It is the one place that Java actually is better than Objective-C.
_______________________________________________
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.

  • Follow-Ups:
    • Re: multithreaded vs ...?
      • From: "Erik M. Buck" <email@hidden>
References: 
 >Re: multithreaded vs ...? (From: Raphael Sebbe <email@hidden>)

  • Prev by Date: Re: Idle Time in a loop
  • Next by Date: Re: multithreaded vs ...?
  • Previous by thread: Re: multithreaded vs ...?
  • Next by thread: Re: multithreaded vs ...?
  • Index(es):
    • Date
    • Thread