c# - .NET equvalent of Java's NIO Selector -
I know that the network is the Net Asynchronous model for I / O, which uses the full port under the hood. But all callbacks are coming from thread pools on IO threads.
Is there a .NET equivalent like Java selector that works with multiple streams in single thread? Or, thread pool callback is better than this single threaded approach?
Thanks,
DOD
for ASINC operation An IO handle is connected to the thread pool when the async operation is completed, I believe that the callback (for each stream) can be executed using the same thread, whether an available thread pool thread processed the callback It is quite possible that the same thread can process multiple callbacks or only one runtime Callback based on practices.
Hope this helps
Edit: Adding an answer to Dodd's comment
I am not well aware of the selector API posted on an example It seems that the selector waits till all events happen, is this true? If this is so, a collar has to wait for all the incidents, even when one event happens faster than the other. But if the selector works by processing an event, as soon as it happens, then one can run in a situation where the selector is processing the callback for an incident, while another incident occurs (I think In this case, the incident will be in the queue somewhere or else you want to leave the events), but whenever the incidents are orthogonal, the throughput decreases and as soon as they are there From it should be processed.
In the .net, the async model is centered around the thread pool, reduce the upper part of creating a new thread (since this is an expensive operation) If you are seeing that the thread pool is maximizing So you can increase the number of threads in the pool. Keep in mind that at the end of the day you are limited to the number of processors. I. Only two threads are running on a dual core box, all others have been blocked so that it is possible to take something into account.
Hope it helps.
Comments
Post a Comment