[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nsrunloop is not using select?
From: |
Richard Frith-Macdonald |
Subject: |
Re: nsrunloop is not using select? |
Date: |
Tue, 23 Jan 2007 07:30:48 +0000 |
On 23 Jan 2007, at 07:11, Rogelio Serrano wrote:
Why is nsrunloop not using select?
It uses the best mechanism for the platform you are running on ...
win32 uses waitformultipleobjects
most unixes will use poll() because of better performance and
scalability than select
where poll() is not available or is less efficient than select(), it
will use select()
And how does nsconnection work with nsrunloop?
That's too big a discussion for an email, but the very short answer
is that it adds ports to the runloop and handles messages arriving on
those ports. For more detail you should go to the documentation of
the classes.
And how does multithreaded nsconnections fit in an nsrunloop?
A multithreaded connection is one where the same port is added to the
runloops of multiple threads. The thread safety issues make it less
efficient than single threaded connections.