How are I / O operations blocked?

I specifically refer to InputStream (Java SE) and its implementation.

How is blocking performed? I'm a little worried that they use a wait mechanism, as this can lead to a lot of overhead. I think they do it differently, but I just want to be sure.

+4
source share
1 answer

No, they do not use expectation. It depends on the implementation (which will depend on the type of input stream used), but, as a rule, it can use an OS-level blocking API, so the efficiency will depend on the OS.

+5
source

Source: https://habr.com/ru/post/1306105/


All Articles