Re: Grand Central Details
Re: Grand Central Details
- Subject: Re: Grand Central Details
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 17 Jun 2008 18:40:07 -0700
On Jun 17, 2008, at 6:02 PM, Michael Gardner wrote:
Too bad you can't avoid blocking at least occasionally with the
event-driven APIs, meaning you still have to use threads to avoid it
completely. And I fail to see what's so bad about having one thread
per socket. Is it because Threads Are Hard?
In that case, it is because threads are relatively expensive. Every
thread adds a bit of memory use -- not insignificant given each
individual thread's stack -- and scheduling overhead. In this model,
you'd expect that most threads will be blocked on I/O most of the
time, but you might also likely find that performance goes to hell in
a handbasket as soon as multiple sockets are lit up with inbound data.
And, yes, threads are hard, though -- in this case -- that hardness is
a bit irrelevant in that the real challenge is how to get data *out*
of the thread dealing with network I/O and *into* the threads dealing
with data.
b.bum
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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