Re: Looking for performance-oneway asynch call
Re: Looking for performance-oneway asynch call
- Subject: Re: Looking for performance-oneway asynch call
- From: kubernan <email@hidden>
- Date: Fri, 1 Nov 2002 11:06:34 +0100
Hello,
I tried -(oneway void) method call without success.
It seems to me elegant to send errors in synchronous way
and all other kind of information in -(oneway void) design.
And this is what i do : as soon as a new request is receveid
from the server and if this request is not wrong, the server
create a new thread from where informations are sent
to the client using -(oneway void) methods.
In my software, the client GUI receives lots of information
from the detached server thread. And is quick enough.
The problem comes when i create a new request (a wrong request
in my test). Even if i use -(oneway void) for errors the message
is received by the client only after a long time.
My server is designed like this :
mainController
that runs in loop and receives client request
For each new request, check it and if the request
is in error, returns the error (synchronous).
If the request is available, create a new instance
of my own object and call a method in this instance.
In the new instance : create a new thread that do the stuff
for the client request. In the thread, informations of the work
are sent to the client using -(oneway void).
Client side
WindowController
Create a new request and call the server. Wait the response
synchronously.
If the sync. response it not nil, an alert is display.
Other methods of the window controller are called by the server.
All my code is in Objective-C.
Any new idea ?
Thx again.
K.
Le vendredi, 1 nov 2002, ` 01:24 Europe/Paris, Lindsey Spratt a icrit :
On Thu, 31 Oct 2002 21:58:46 +0100, kubernan <email@hidden>
wrote:
I tried to add some locks in my code, i tried to avoid the synchronous
reply from the server but there is always the same problem.
It seems like using an asynchronous call (and doing the validity check
on the calling thread) would get around your performance problem.
Did you use the "oneway void" declaration on the target of the
meant-to-be asynchronous call?
Something like:
-(oneway void)asynchMethod
{
//do stuff
}
Without the oneway attribute, as I understand it, *all* messages are
synchronous, whether or not the message sending/method calling code
explicitly expects a result or not.
Lindsey Spratt
http://homepage.mac.com/lspratt
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.