• 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: What's better a separate run loop or separate thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's better a separate run loop or separate thread?


  • Subject: Re: What's better a separate run loop or separate thread?
  • From: Ken Tozier <email@hidden>
  • Date: Sun, 11 Jul 2004 22:28:33 -0400

On Jul 11, 2004, at 6:05 PM, Dustin Voss wrote:

<snip>

If you go the thread route, here are some helpful classes:

ThreadWorker, http://iharder.sourceforge.net/macosx/threadworker, lets you run and stop a thread, and will inform you when the thread has completed its work. This may not be applicable to you.

I've just been sending start thread/stop thread notifications to those classes that need to know about it. Is there a gotcha somewhere in there? The classes are written in such a way that they only fork threads one at a time, maybe that's why I haven't run into problems.

InterThreadMessaging, http://homepage.mac.com/d.j.v./FileSharing10.html, lets your main and worker thread send messages or notifications to each other.

I don't know if it's just dumb luck on my part (I've only been using threads for about two weeks) but I didn't notice any problems sending notifications from threads. I just post them from inside the thread and they magically arrive at their destination.

You may also want to check out http://cocoadev.com/?NSThread, which has some advice on threading.

I'll do that thanks.

Ken
_______________________________________________
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: What's better a separate run loop or separate thread?
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: [SOLVED] Re: Authenticating without UI
  • Next by Date: Determining if a method is a class or instance method
  • Previous by thread: Re: What's better a separate run loop or separate thread?
  • Next by thread: Re: What's better a separate run loop or separate thread?
  • Index(es):
    • Date
    • Thread