Java's NIO is Synchronize non-blocking, but why is its core Selector.select () blocking?

Java"s NIO is Synchronize non-blocking, but why is its core Selector.select () blocking? Is it not contradictory?

Selector selector = Selector.open();
while (true) {
    int nReady = selector.select(); // 
    Set<SelectionKey> keys = selector.selectedKeys();
    Iterator<SelectionKey> it = keys.iterator();
    //...
}
Dec.16,2021

Don't confuse select with io itself. Select is a butler, and a select can check multiple io reads and writes at the same time, and each io is non-blocking.

in addition, don't forget that selectNow, even the butler, select, is non-blocking.


the phrase "NIO" is Synchronize non-blocking means that for an IO, it is Synchronize non-blocking, which means that the thread that owns the IO does not block, while in NIO, a thread has a lot of IO, and any IO has data, the selector is awakened, so you can think of it this way: in this thread, when IOA has no data waiting, IOB may be being processed. So the thread is not blocked by the IOA.
feels that you are too obsessed with blocking and non-blocking, so you don't have to worry so much about it.
and NIO. I think strictly speaking, it should be multiplexing, not Synchronize non-blocking

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b42285-2c5f9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b42285-2c5f9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?