If you use kqueue(), should you set O_NONBLOCK on your file descriptors? In other words, does kqueue() guarantee that the next I/O operation on a ready file descriptor will not block, regardless of whether O_NONBLOCK is set?
相关问题
- What is the best way to do a search in a large fil
- In what practical case bool(std::ifstream) != std:
- aio_write on linux with rtkaio is sometimes long
- Using Ruby's “ready?” IO method with gets, put
- Using FileWriter and BufferedWriter clearing file
相关文章
- Fastest way to create files in C#
- How can I resolve a relative path to absolute path
- What is the difference between `ioToST` and `unsaf
- Reader interface and the Read method in golang
- Is there an equivalent of BufferedReader.readLine(
- Is there some directory walker in Haskell?
- How to print jq output sequentially
- Python pandas: read file skipping commented
Nope.
Yep.
You do not need to. However, I generally do as a sanity check. This makes operations like read() return -1 and set errno to EWOULDBLOCK. I would much rather get an EWOULDBLOCK and know that my implementation of kqueue is buggy than have read() calls block (and therefore my program freeze) for unknown reasons.