Re: Where do asynchronous API do their "work"?
Re: Where do asynchronous API do their "work"?
- Subject: Re: Where do asynchronous API do their "work"?
- From: AgentM <email@hidden>
- Date: Mon, 14 Nov 2005 11:49:39 -0600
If you look into the open-source component of CFSocket and friends,
you will see that indeed CFSocket spawns a thread for itself. This
thread (used for all sockets registered with it) blocks on a select()
and when when a socket event occurs, the thread sends a mach message
to the main thread which calls the respective Objective-C routines.
http://darwinsource.opendarwin.org/10.4/CF-368/RunLoop.subproj/
CFSocket.c
Probably for performance reasons, CFRunLoop doesn't support polling
on file descriptors itself with select(). However, I would love to
see CFRunLoop use and support kqueues natively since it offers more
features and less overhead than select() or poll(). (kqueue available
only in >=10.3)
GNUStep's NSRunLoop does support file descriptor polling (a good idea
since there is no mach messaging in POSIX) and, AFAIK, there has been
no trouble with performance due to this.
|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
AgentM
email@hidden
|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden