Re: SIGIO and AppKit main loop
Re: SIGIO and AppKit main loop
- Subject: Re: SIGIO and AppKit main loop
- From: Douglas Davidson <email@hidden>
- Date: Mon, 29 Mar 2004 10:08:33 -0800
On Mar 29, 2004, at 4:55 AM, Michael Rothwell wrote:
Cocoa appears to have no equivalent of glib's "IO Channels," which are
really useful, and do not use threads. GIOChannel integrates with the
application's main thread and invokes callback functions for registered
events, such as ready-to-read, ready-to-write, ready-to-accept, etc. I
imagine it integrates the file descriptor in question with a
general-purpose select() or poll() done in the main application loop.
CFSocket does exactly that. The more convenient interfaces for most
purposes are the higher-level CFStream, NSStream, et al. See e.g.
<
http://developer.apple.com/documentation/Networking/Conceptual/
CFNetwork/Preface/>
The original question referred to signals. Cocoa does not interfere
with signal delivery, but Cocoa calls must be treated as unsafe to use
from signal handlers. This is not a Cocoa-specific issue; there really
is very little that can be done safely from a signal handler. The
suggestion of setting a flag and handling it elsewhere is probably
best.
Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.