RunLoops
RunLoops
- Subject: RunLoops
- From: Martin Tauber <email@hidden>
- Date: Sat, 5 Nov 2005 23:41:55 +0100
Hi Cocoa-dev!
I have some questions concerning RunLoops. I was reading the
documentation for NSRunLoop and I saw that a RunLoop can be started in
different modes (NSDefaultRunLoopMode and NSConnectionReplyMode). I was
already wondering how the runLoop is handling different event sources
(types liek sockets and mouse clicks). From my time as a UNIX developer
I know that I can asychronisally read from files and sockets. Making a
request to read different sources and then waiting for a source to
reply or for the function call to time out. Well this is how the
runloop could handle NSPort or NSConnection sources. But then in the
meantime it could not react to other event sources (like mouse clicks
for example). Is this why the runLoop can (or must?) be run in
different modes? But which mode would then except which source?
On the other hand when I was debugging my application I saw a thread
that I didn't create. Now my thinking was that if there is more than
one event source (for example NSPorts and mouseEvents) the runLoop is
listening to, maybe it delegates the listening to threads and then just
waits for the threads to tell the runLoop that a event arrived.
Does anyone know how this works? (I hope this was not to confusing)
Thanks
Martin
_______________________________________________
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