Why FileChannel in Java is not non-blocking?

后端 未结 2 1572
花落未央
花落未央 2020-12-24 07:34

I wanted to write a program which writes to multiple files simultaneously; thought it will be possible with one thread by using non-blocking mode. But FileChannel does not s

2条回答
  •  [愿得一人]
    2020-12-24 08:29

    Simply put, most operating systems doesn't treat regular files as something that can block - so they don't allow you explicitly set them to a non-blocking state.

提交回复
热议问题