From a performance standpoint, which one is better? select/poll or asynchronous I/O? My earlier impression was select/poll repeatedly asks the kernel for data, whereas asynchronous I/O relies on kernel's notification for data availability. However, I have noticed that select/poll also relies on kernel notifications. So, I believe from a performance standpoint both are same. The only difference is that select/poll blocks whereas asynchronous I/O does not. Am I correct or am I missing something?
相关问题
- What is the best way to do a search in a large fil
- how to get selected text from iframe with javascri
- Faster loop: foreach vs some (performance of jsper
- Why wrapping a function into a lambda potentially
- In what practical case bool(std::ifstream) != std:
相关文章
- DOM penalty of using html attributes
- Which is faster, pointer access or reference acces
- Django is sooo slow? errno 32 broken pipe? dcramer
- Understanding the difference between Collection.is
- With a Promise, why do browsers return a reject tw
- Asynchronous SHA256 Hashing
- Does aiohttp have ORM?
- parallelizing matrix multiplication through thread
With async I/O, you have to loop continiously and check to see if there is new data to read periodically. This makes it CPU intensive. Select/poll simply blocks, taking up no CPU power. It does not loop internally.
select/poll also relies on kernel notification for ready filedeskriptors. But the disadvantage of select/poll is that they block as soon they are called because the Systemcall-Handler runs in the Kernel-Space.
Real asynchronous I/O is achieved via LibAIO (on Linux) and IOCP on Windows. As far as i know they dont block the calling process/thread in der User Space and they allow real overlapped I/O.
That means asynchronous Non Blocking I/O (LibAIO & IOCP) is faster, because it does not block the calling Thread and they allow real overlapped I/O. Select/poll are also asynchronous, but they are Asynchronous Blocking. And btw select and poll suffer from other specific problems so that they cant scale that well.
Hope i could help u. (I am a newbie on this too :))