• 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
DO message received on wrong thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Writing to a specified NSUserDefaults domain
  • Next by Date: Re: Core Data, NSOutlineView and NSSortDescriptors
  • Previous by thread: Re: Core Data, NSOutlineView and NSSortDescriptors
  • Next by thread: NSTableView, fieldEditor, setRowHeight
  • Index(es):
    • Date
    • Thread