• 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: event driven vs blocking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: event driven vs blocking


  • Subject: Re: event driven vs blocking
  • From: Quinn <email@hidden>
  • Date: Tue, 21 May 2002 15:02:41 +0100

At 14:28 -0700 13/5/02, Chris Silverberg wrote:
So, here's the bottom line question... should I really avoid (or not even
consider) creating 11 threads because of performance considerations? Or is
this still a reasonable approach... maybe not as efficient as event driven,
but much less complex and therefore a good solution?

Threads are a two edged sword. You definitely get the best performance out of sockets by using blocking calls with threads (although it's only marginally better than the CFNetwork stuff). However, you consume more memory (for a variety of reasons but most noticeably you consume a kernel stack while blocked, 21 KB of wired memory according to "IMOSX:Performance").

All-in-all I recommend that you go with the code that is easiest to write. You'll get acceptable performance with either solution and in most circumstances the long-term maintainability of your code is more important than micro-optimising it for a specific platform.

S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

References: 
 >event driven vs blocking (From: Chris Silverberg <email@hidden>)

  • Prev by Date: Re: TCPIP Load only when needed
  • Next by Date: Re: OT & Carbon issues
  • Previous by thread: event driven vs blocking
  • Next by thread: Informing PPP of Disconnect
  • Index(es):
    • Date
    • Thread