Re: Sockets and Network Disconnect?
Re: Sockets and Network Disconnect?
- Subject: Re: Sockets and Network Disconnect?
- From: Jens Alfke <email@hidden>
- Date: Fri, 1 Aug 2008 12:10:24 -0700
On 1 Aug '08, at 4:52 AM, Quinn wrote:
NSOperationQueue certainly runs the operations on threads. However,
the idea is for the operations to do their work and then return,
having arranged for the next operation to be started when necessary.
That way the system can use a small pool of threads to handle a
large number of operations If your operation is blocking on the
network, it's subverting that goal.
I don't think this is a problem. For example, I know that Mail runs
its network code in threaded NSOperations, and I'm pretty certain that
code is all synchronous — it definitely was pre-Leopard, and there's
no way anyone would want to refactor a mature and very complicated POP/
IMAP/SMTP implementation to make it async!
Certainly if you had hundreds or thousands of simultaneous network
operations, the large number of threads could bog down the system. But
that's very unlikely; and anyway, NSOperationQueue already supports
limiting the number of simultaneously-active operations.
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden