Re: Problem using data in a distributed object
Re: Problem using data in a distributed object
- Subject: Re: Problem using data in a distributed object
- From: Ken Thomases <email@hidden>
- Date: Mon, 30 May 2011 11:55:55 -0500
On May 30, 2011, at 10:20 AM, Ken Tozier wrote:
> I wrote two apps that communicate through distributed objects and found this weird "feature" where if a string is distributed by one app, the receiving app can't use it to create other strings. For example
>
> str1 is vended from app A
> App B wants to take that string and append some text to the end, like so
>
> NSString *newString = [vendedString stringByAppendingString: @"testing 1, 2, 3"];
>
> Not sure why, but once the execution reaches that step, the program just stops dead in it's tracks. It doesn't crash, but just seems to get hung on that line, never executing anything beyond it. Is there a way to actually use data vended by a distributed object other than to passively read it? If so, how?
I'm guessing that whatever method vended the string didn't do so with the bycopy qualifier. Therefore, you have a proxy of the string object and any messages you send it require communication with the server.
The deadlock is probably because of a problem in the design of the communication between the server and your client -- you are asking the server to process your request, but maybe the server is blocked trying to send the client a message. When you hit a deadlock, you can interrupt/pause the programs in the debugger and examine the backtraces of their threads. You'll probably see why they are deadlocked, because each is doing something that requires a response from the other before it can proceed.
Getting the string bycopy may be sufficient to solve this deadlock. However, you should carefully reexamine the design of the interaction between the client and server.
Good luck,
Ken
_______________________________________________
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