• 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
worker thread iterating over array - SLOW
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

worker thread iterating over array - SLOW


  • Subject: worker thread iterating over array - SLOW
  • From: Peter Lübke <email@hidden>
  • Date: Tue, 1 Feb 2011 00:13:18 +0100

Hi list,

I use a worker thread in my app that invokes the same method(s) on all objects in an array sent from the main thread. The array may contain thousands of objects.
The main thread communicates with the worker thread via distributed objects.


Everything works fine except performance is too slow.
Seems to me that my NSConnection asks for the method signature each time the method is invoked on an object in the array, thus adding massive overhead.


The shared objects approach - call NSThread's - detachNewThreadSelector:toTarget:withObject: with the array as argument 3, have the secondary thread do the job and exit - is way faster!

I just started using DO and probably missed more than one thing, so any help is very much appreciated.

- Peter
_______________________________________________

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: worker thread iterating over array - SLOW
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Main menu in NSDocument based application
  • Next by Date: Re: text orientation/positioning with layout manager
  • Previous by thread: Re: Main menu in NSDocument based application
  • Next by thread: Re: worker thread iterating over array - SLOW
  • Index(es):
    • Date
    • Thread