Re: Threaded Server using Distributed Objects
Re: Threaded Server using Distributed Objects
- Subject: Re: Threaded Server using Distributed Objects
- From: Michael Ash <email@hidden>
- Date: Sat, 21 Mar 2009 14:37:41 -0400
On Sat, Mar 21, 2009 at 6:33 AM, Alan Shouls <email@hidden> wrote:
> Hi,
>
> I am implementing a simple client/server using Distributed Objects. I have a
> single server and a small number of clients. The clients are all on the same
> machine so I communicate using an NSMachPort, and use 'NSConnection'
> 'registerName' to register a single connection name on which to communicate.
> It all works fine. My only issue is that the server is not threaded - so if
> if one client asks the server to do something time-consuing the the request
> coming from a different next client will have to wait.
>
> So on to my question. I would like to implement a threaded server, what I
> mean is I would like to have a small number of threads so that concurrent
> requests can happen. If one thread is busy then the a free thread can take
> up the challenge. Is it possible to have this on a single named connection?
> If so could someone give me a few pointers or a leg-up as to how to go about
> this.
I've never done it, but it looks to me like you can make multiple
calls to the -addRunLoop: method to get the NSConnection to use
multiple threads for responding to requests.
Mike
_______________________________________________
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