package picos
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=544804c0bde4b29764f82f04e7defed7c06bc43e5a6ce3f7fdc326cb54a7f066
sha512=4c93427e477fb52374a554a8b9c4c92836a9b5899161275d1473269ab526a1f59177209140631ed763a55be375855dea12f076e18bf4124522414986c0e257be
doc/picos.select/Picos_select/Intr/index.html
Module Picos_select.Intr
Source
A mechanism to interrupt blocking Unix
IO operations.
⚠️ The mechanism uses a signal which should not be used for other purposes.
⚠️ Beware that signal handling in OCaml 5.0.0 is known to be broken and several fixes were included in OCaml 5.1.0.
Represents an optional interrupt request.
A constant for a no request. clr nothing
does nothing.
req ~seconds
requests an interrupt in the form of a signal delivered to the thread that made the request within the specified number of seconds
. Blocking Unix
IO calls typically raise an error with the Unix.EINTR
error code when they are interrupted by a signal. Regardless of whether the signal gets triggered or a system call gets interrupted, the request must be cleared exactly once!
⚠️ Due to limitations of the OCaml system modules and unlike with typical timeout mechanisms, the interrupt may also be triggered sooner.