DO message received on wrong thread
DO message received on wrong thread
- Subject: DO message received on wrong thread
- From: "Adam R. Maxwell" <email@hidden>
- Date: Mon, 23 Apr 2007 07:55:48 -0700
I'm having a hard time tracking down a Distributed Objects problem,
and wonder if anyone can provide some insight. We do some background
processing on a worker/server thread, which sits idle until it gets a
message via a proxy to do some work.
The message that starts the server working is
- (oneway void)doSomething:(in bycopy NSString *)aString;
{
NSMutableArray *result = [NSMutableArray array];
// do some processing
[mainThreadProxy workComplete:result];
}
- (void)workComplete:(bycopy NSArray *)obj;
{
// inform delegate and update UI
}
When this method completes, the server object messages itself on the
main thread using a proxy (NSDistantObject), and various UI updates
occur. Ordinarily, this works well.
If we pass an empty string as the aString argument, no work is done in
the server method, and the server's message that work is complete ends
up being received on the server thread (when it should be received on
the main thread). If I run the runloop briefly before messaging
mainThreadProxy, things work as expected, but I'd like to understand
what's going on, since this could potentially cause problems in
various parts of the code.
If anyone is really interested in looking at the actual code, it's all
open source.
thanks,
Adam
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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