• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sockets and Network Disconnect?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Sockets and Network Disconnect? (From: Karl Moskowski <email@hidden>)
 >Re: Sockets and Network Disconnect? (From: Quinn <email@hidden>)

  • Prev by Date: Re: Sockets and Network Disconnect?
  • Next by Date: Arguments for callback function
  • Previous by thread: Re: Sockets and Network Disconnect?
  • Next by thread: Arguments for callback function
  • Index(es):
    • Date
    • Thread