Am 01.02.2011 um 00:20 schrieb A.M.:


On Jan 31, 2011, at 6:13 PM, Peter Lübke wrote:

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.

Did you set the root proxy protocol?
-[NSDistantObject setProtocolForProxy:]


I can -setProtocolForProxy: for the proxy for the array, but I can't do it for the objects in the array, right?


Perhaps you could also look at -[NSRunLoop performSelector:onThread:withObject:waitUntilDone:].


You probably meant -[NSObject performSelector:onThread:withObject:waitUntilDone:].

The -performSelector:... methods don't offer the flexibility I need here, so I'll rather have to go for NSInvocation. Besides from this, I'd like my app to continue running in Tiger, and unfortunately, in Tiger there's only - performSelectorOnMainThread:... . methods.

Cheers,
Peter


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to