Re: event driven vs blocking
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.