Re: Accessing NSDistantObject from different threads concurrently
Re: Accessing NSDistantObject from different threads concurrently
- Subject: Re: Accessing NSDistantObject from different threads concurrently
- From: Oleg Krupnov <email@hidden>
- Date: Mon, 20 Sep 2010 20:32:01 +0300
Thanks, Kyle
> Multithreading is not a prerequisite for serving multiple clients. Depending on what your server's doing, sticking with NSRunLoop-based multiplexing might be a lot easier.
The server's job is associated with slow devices, such as disk, but
are quite lengthy in time. In your scenario, all client threads will
be unnecessarily waiting for the server to complete the current job,
while there is still a lot of CPU time to run the other jobs
concurrently.
> The NSConnection documentation has a bunch of methods for dealing with multiple threads.
Maybe you're right, but I haven't found examples. A pointer would be
appreciated. Am I correct assuming that by default there is only one
thread in the server process, and if multiple threads are trying to
access the proxy, all but one will be blocked?
> In your case, though, it sounds like you only want to vend one object through which all your clients communicate. Even if that communication is achieved by asking the vended object for another object with which to communicate.
I don't mind to vend only a single object, through which to ask for
the other object to actually communicate with clients. I've been
thinking about it myself. The problem is how to spawn a new thread for
each such object in the server process and make it listen to all
incoming requests from the corresponding client.
Thanks,
Oleg.
_______________________________________________
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