From 1f18591b23c04990726d62ddbfb13b8d835b3b53 Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Tue, 3 Sep 2024 22:17:19 +0300 Subject: [PATCH] Rename `picos_stdio` to `picos_io` This avoids a linting warning on OPAM CI. --- CHANGES.md | 12 ++++---- README.md | 4 +-- bench/bench_binaries.ml | 8 +++--- bench/bench_stdio.ml | 2 +- bench/dune | 4 +-- bench/main.ml | 2 +- dune-project | 14 +++++----- lib/{picos_stdio.fd => picos_io.fd}/dune | 4 +-- .../picos_io_fd.ml} | 0 .../picos_io_fd.mli} | 0 .../dune | 14 +++++----- .../picos_io_select.ml} | 16 +++++------ .../picos_io_select.mli} | 14 +++++----- lib/picos_io.thread_atomic/dune | 3 ++ .../picos_io_thread_atomic.ml} | 0 .../picos_io_thread_atomic.mli} | 0 lib/{picos_stdio => picos_io}/dune | 16 +++++------ lib/{picos_stdio => picos_io}/index.mld | 6 ++-- .../picos_stdio.ml => picos_io/picos_io.ml} | 4 +-- .../picos_stdio.mli => picos_io/picos_io.mli} | 12 ++++---- .../dune | 14 +++++----- lib/picos_io_cohttp/index.mld | 8 ++++++ .../picos_io_cohttp.ml} | 2 +- .../picos_io_cohttp.mli} | 10 +++---- lib/picos_mux.fifo/dune | 2 +- lib/picos_mux.fifo/picos_mux_fifo.mli | 6 ++-- lib/picos_mux.fifo/select.none.ml | 2 +- lib/picos_mux.fifo/select.some.ml | 4 +-- lib/picos_mux.multififo/dune | 2 +- .../picos_mux_multififo.mli | 6 ++-- lib/picos_mux.multififo/select.none.ml | 2 +- lib/picos_mux.multififo/select.some.ml | 4 +-- lib/picos_mux.random/dune | 2 +- lib/picos_mux.random/picos_mux_random.mli | 6 ++-- lib/picos_mux.random/select.none.ml | 2 +- lib/picos_mux.random/select.some.ml | 4 +-- lib/picos_mux.thread/dune | 2 +- lib/picos_mux.thread/picos_mux_thread.mli | 16 ++--------- lib/picos_mux.thread/select.none.ml | 2 +- lib/picos_mux.thread/select.some.ml | 4 +-- lib/picos_std.event/picos_std_event.mli | 2 +- lib/picos_std.finally/dune | 2 +- lib/picos_std.finally/picos_std_finally.mli | 2 +- lib/picos_std.structured/dune | 4 +-- .../picos_std_structured.mli | 16 +++++------ lib/picos_stdio.thread_atomic/dune | 3 -- lib/picos_stdio_cohttp/index.mld | 8 ------ picos_stdio.opam => picos_io.opam | 0 ..._stdio_cohttp.opam => picos_io_cohttp.opam | 4 +-- picos_meta.opam | 4 +-- picos_mux.opam | 2 +- test/dune | 28 +++++++++---------- test/{test_stdio.ml => test_io.ml} | 8 +++--- ...test_stdio_cohttp.ml => test_io_cohttp.ml} | 6 ++-- ..._stdio_with_lwt.ml => test_io_with_lwt.ml} | 4 +-- test/test_scheduler.ocaml4.ml | 4 +-- test/test_scheduler.ocaml5.ml | 4 +-- test/test_select.ml | 6 ++-- test/test_server_and_client.ml | 2 +- 59 files changed, 166 insertions(+), 178 deletions(-) rename lib/{picos_stdio.fd => picos_io.fd}/dune (51%) rename lib/{picos_stdio.fd/picos_stdio_fd.ml => picos_io.fd/picos_io_fd.ml} (100%) rename lib/{picos_stdio.fd/picos_stdio_fd.mli => picos_io.fd/picos_io_fd.mli} (100%) rename lib/{picos_stdio.select => picos_io.select}/dune (68%) rename lib/{picos_stdio.select/picos_stdio_select.ml => picos_io.select/picos_io_select.ml} (97%) rename lib/{picos_stdio.select/picos_stdio_select.mli => picos_io.select/picos_io_select.mli} (95%) create mode 100644 lib/picos_io.thread_atomic/dune rename lib/{picos_stdio.thread_atomic/picos_stdio_thread_atomic.ml => picos_io.thread_atomic/picos_io_thread_atomic.ml} (100%) rename lib/{picos_stdio.thread_atomic/picos_stdio_thread_atomic.mli => picos_io.thread_atomic/picos_io_thread_atomic.mli} (100%) rename lib/{picos_stdio => picos_io}/dune (64%) rename lib/{picos_stdio => picos_io}/index.mld (85%) rename lib/{picos_stdio/picos_stdio.ml => picos_io/picos_io.ml} (99%) rename lib/{picos_stdio/picos_stdio.mli => picos_io/picos_io.mli} (98%) rename lib/{picos_stdio_cohttp => picos_io_cohttp}/dune (66%) create mode 100644 lib/picos_io_cohttp/index.mld rename lib/{picos_stdio_cohttp/picos_stdio_cohttp.ml => picos_io_cohttp/picos_io_cohttp.ml} (99%) rename lib/{picos_stdio_cohttp/picos_stdio_cohttp.mli => picos_io_cohttp/picos_io_cohttp.mli} (96%) delete mode 100644 lib/picos_stdio.thread_atomic/dune delete mode 100644 lib/picos_stdio_cohttp/index.mld rename picos_stdio.opam => picos_io.opam (100%) rename picos_stdio_cohttp.opam => picos_io_cohttp.opam (90%) rename test/{test_stdio.ml => test_io.ml} (96%) rename test/{test_stdio_cohttp.ml => test_io_cohttp.ml} (94%) rename test/{test_stdio_with_lwt.ml => test_io_with_lwt.ml} (91%) diff --git a/CHANGES.md b/CHANGES.md index 4cab253d..26128ea6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -57,12 +57,12 @@ - lib: `picos_std.finally` - lib: `picos_std.structured` - lib: `picos_std.sync` - - pkg: `picos_stdio` - - lib: `picos_stdio` - - lib: `picos_stdio.fd` - - lib: `picos_stdio.select` - - pkg: `picos_stdio_cohttp` - - lib: `picos_stdio_cohttp` + - pkg: `picos_io` + - lib: `picos_io` + - lib: `picos_io.fd` + - lib: `picos_io.select` + - pkg: `picos_io_cohttp` + - lib: `picos_io_cohttp` ## 0.4.0 diff --git a/README.md b/README.md index bdd4def0..26e31b8e 100644 --- a/README.md +++ b/README.md @@ -623,7 +623,7 @@ _Implemented in Picos_. These libraries include [a library for structured concurrency](https://ocaml-multicore.github.io/picos/doc/picos_std/Picos_std_structured/index.html), [a library of synchronization primitives](https://ocaml-multicore.github.io/picos/doc/picos_std/Picos_std_sync/index.html), and -[an asynchronous I/O library](https://ocaml-multicore.github.io/picos/doc/picos_stdio/Picos_stdio/index.html). +[an asynchronous I/O library](https://ocaml-multicore.github.io/picos/doc/picos_io/Picos_io/index.html). The synchronization library and the I/O library intentionally mimic libraries that come with the OCaml distribution. All of the libraries work with all of the schedulers and all of these _elements_ are interoperable and entirely opt-in. @@ -662,7 +662,7 @@ let run_server server_fd = ``` The -[`Unix`](https://ocaml-multicore.github.io/picos/doc/picos_stdio/Picos_stdio/Unix/index.html) +[`Unix`](https://ocaml-multicore.github.io/picos/doc/picos_io/Picos_io/Unix/index.html) module is provided by the I/O library. The operations on file descriptors on that module, such as `accept`, `read`, and `write`, use the Picos interface to suspend fibers allowing other fibers to run while waiting for I/O. The diff --git a/bench/bench_binaries.ml b/bench/bench_binaries.ml index abaf70f2..f15c5d33 100644 --- a/bench/bench_binaries.ml +++ b/bench/bench_binaries.ml @@ -29,10 +29,10 @@ let paths = lib "picos_std.finally"; lib "picos_std.structured"; lib "picos_std.sync"; - lib "picos_stdio"; - lib "picos_stdio.fd"; - lib "picos_stdio.select"; - lib "picos_stdio_cohttp"; + lib "picos_io"; + lib "picos_io.fd"; + lib "picos_io.select"; + lib "picos_io_cohttp"; ] let run_suite ~budgetf:_ = diff --git a/bench/bench_stdio.ml b/bench/bench_stdio.ml index 292df202..07e4b996 100644 --- a/bench/bench_stdio.ml +++ b/bench/bench_stdio.ml @@ -1,5 +1,5 @@ open Multicore_bench -open Picos_stdio +open Picos_io let run_one ~budgetf ~block_or_nonblock ~n_domains () = let block_size = 4096 in diff --git a/bench/dune b/bench/dune index c324cd0f..2f5da606 100644 --- a/bench/dune +++ b/bench/dune @@ -33,11 +33,11 @@ picos_aux.htbl picos_aux.mpmcq picos_aux.mpscq + picos_io + picos_io.select picos_std.finally picos_std.structured picos_std.sync - picos_stdio - picos_stdio.select (select scheduler.ml from diff --git a/bench/main.ml b/bench/main.ml index 50a33de0..423c3774 100644 --- a/bench/main.ml +++ b/bench/main.ml @@ -1,4 +1,4 @@ -let () = Picos_stdio_select.configure () +let () = Picos_io_select.configure () let benchmarks = [ diff --git a/dune-project b/dune-project index b61e5e6c..3bf3a0b4 100644 --- a/dune-project +++ b/dune-project @@ -63,7 +63,7 @@ )) (package - (name picos_stdio) + (name picos_io) (synopsis "Asynchronous IO system for Picos") (depends (picos_aux @@ -83,10 +83,10 @@ )) (package - (name picos_stdio_cohttp) - (synopsis "Cohttp running on Picos stdio") + (name picos_io_cohttp) + (synopsis "Cohttp running on Picos IO") (depends - (picos_stdio + (picos_io (= :version)) ;; (cohttp @@ -114,7 +114,7 @@ ;; ) (depopts - (picos_stdio + (picos_io (= :version)) ;; )) @@ -145,9 +145,9 @@ (= :version)) (picos_std (= :version)) - (picos_stdio + (picos_io (= :version)) - (picos_stdio_cohttp + (picos_io_cohttp (= :version)) (picos_mux (= :version)) diff --git a/lib/picos_stdio.fd/dune b/lib/picos_io.fd/dune similarity index 51% rename from lib/picos_stdio.fd/dune rename to lib/picos_io.fd/dune index 9a16f8a3..ebcc852b 100644 --- a/lib/picos_stdio.fd/dune +++ b/lib/picos_io.fd/dune @@ -1,6 +1,6 @@ (library - (name picos_stdio_fd) - (public_name picos_stdio.fd) + (name picos_io_fd) + (public_name picos_io.fd) (libraries (re_export unix) picos_aux.rc)) diff --git a/lib/picos_stdio.fd/picos_stdio_fd.ml b/lib/picos_io.fd/picos_io_fd.ml similarity index 100% rename from lib/picos_stdio.fd/picos_stdio_fd.ml rename to lib/picos_io.fd/picos_io_fd.ml diff --git a/lib/picos_stdio.fd/picos_stdio_fd.mli b/lib/picos_io.fd/picos_io_fd.mli similarity index 100% rename from lib/picos_stdio.fd/picos_stdio_fd.mli rename to lib/picos_io.fd/picos_io_fd.mli diff --git a/lib/picos_stdio.select/dune b/lib/picos_io.select/dune similarity index 68% rename from lib/picos_stdio.select/dune rename to lib/picos_io.select/dune index b01cfec0..ae5ec5d7 100644 --- a/lib/picos_stdio.select/dune +++ b/lib/picos_io.select/dune @@ -1,11 +1,11 @@ (library - (name picos_stdio_select) - (public_name picos_stdio.select) + (name picos_io_select) + (public_name picos_io.select) (optional) (libraries (re_export picos) + (re_export picos_io.fd) (re_export picos_std.event) - (re_export picos_stdio.fd) (re_export unix) backoff mtime @@ -14,7 +14,7 @@ picos.domain picos.thread picos_aux.htbl - picos_stdio_thread_atomic + picos_io_thread_atomic psq threads.posix)) @@ -24,11 +24,11 @@ (>= %{ocaml_version} 5.1.0)) (libraries picos + picos_io + picos_io.select picos_mux.random picos_std.event picos_std.finally picos_std.structured - picos_stdio - picos_stdio.select unix) - (files picos_stdio_select.mli)) + (files picos_io_select.mli)) diff --git a/lib/picos_stdio.select/picos_stdio_select.ml b/lib/picos_io.select/picos_io_select.ml similarity index 97% rename from lib/picos_stdio.select/picos_stdio_select.ml rename to lib/picos_io.select/picos_io_select.ml index 3ceac825..74cab4e6 100644 --- a/lib/picos_stdio.select/picos_stdio_select.ml +++ b/lib/picos_io.select/picos_io_select.ml @@ -57,7 +57,7 @@ module Q = type return_on = | Return_on : { - file_descr : Picos_stdio_fd.t; + file_descr : Picos_io_fd.t; value : 'a; computation : 'a Computation.t; mutable alive : bool; @@ -162,7 +162,7 @@ type fos = { n : int; unique_fds : Unix.file_descr list; ops : return_on list } let fos_empty = { n = 1; unique_fds = []; ops = [] } -module Ht = Hashtbl.Make (Picos_stdio_fd.Resource) +module Ht = Hashtbl.Make (Picos_io_fd.Resource) let rec process_fds ht unique_fds ops = function | [] -> @@ -170,10 +170,10 @@ let rec process_fds ht unique_fds ops = function else { n = Ht.length ht; unique_fds; ops } | (Return_on r as op) :: ops_todo -> if Computation.is_running r.computation then begin - let file_descr = Picos_stdio_fd.unsafe_get r.file_descr in + let file_descr = Picos_io_fd.unsafe_get r.file_descr in match Ht.find ht file_descr with | `Return -> - Picos_stdio_fd.decr r.file_descr; + Picos_io_fd.decr r.file_descr; r.alive <- false; Computation.return r.computation r.value; process_fds ht unique_fds ops ops_todo @@ -183,7 +183,7 @@ let rec process_fds ht unique_fds ops = function process_fds ht (file_descr :: unique_fds) (op :: ops) ops_todo end else begin - Picos_stdio_fd.decr r.file_descr; + Picos_io_fd.decr r.file_descr; process_fds ht unique_fds ops ops_todo end @@ -210,7 +210,7 @@ let rec process_timeouts s = Mtime.Span.to_float_ns (Mtime.Span.abs_diff e.time elapsed) *. (1. /. 1_000_000_000.) -module Thread_atomic = Picos_stdio_thread_atomic +module Thread_atomic = Picos_io_thread_atomic let rec select_thread s timeout rd wr ex = if s.state == `Alive then begin @@ -424,10 +424,10 @@ let[@alert "-handler"] rec insert_fd s fds (Return_on r as op) = in wakeup s `Alive else insert_fd s fds op - else Picos_stdio_fd.decr r.file_descr + else Picos_io_fd.decr r.file_descr let return_on computation file_descr op value = - Picos_stdio_fd.incr file_descr; + Picos_io_fd.incr file_descr; let s = get () in insert_fd s (match op with `R -> s.new_rd | `W -> s.new_wr | `E -> s.new_ex) diff --git a/lib/picos_stdio.select/picos_stdio_select.mli b/lib/picos_io.select/picos_io_select.mli similarity index 95% rename from lib/picos_stdio.select/picos_stdio_select.mli rename to lib/picos_io.select/picos_io_select.mli index 1703eb5e..32609084 100644 --- a/lib/picos_stdio.select/picos_stdio_select.mli +++ b/lib/picos_io.select/picos_io_select.mli @@ -36,7 +36,7 @@ val timeout : seconds:float -> unit Event.t (** {2 IO} *) val return_on : - 'a Computation.t -> Picos_stdio_fd.t -> [ `R | `W | `E ] -> 'a -> unit + 'a Computation.t -> Picos_io_fd.t -> [ `R | `W | `E ] -> 'a -> unit (** [return_on computation fd op value] arranges for [computation] to be {{!Picos.Computation.return} returned} with given [value] when [fd] becomes available for [op]. Completion of the [computation] before the [fd] becomes @@ -45,10 +45,10 @@ val return_on : ℹ️ Using {!Unix.set_nonblock} and [return_on] you can implement direct-style transparently asynchronous IO on top of the {!Unix} module. *) -val await_on : Picos_stdio_fd.t -> [ `R | `W | `E ] -> Picos_stdio_fd.t +val await_on : Picos_io_fd.t -> [ `R | `W | `E ] -> Picos_io_fd.t (** [await_on fd op] awaits until [fd] becomes available for [op]. *) -val on : Picos_stdio_fd.t -> [ `R | `W | `E ] -> unit Event.t +val on : Picos_io_fd.t -> [ `R | `W | `E ] -> unit Event.t (** [on fd op] returns an {{!Picos_std_event.Event} event} that can be committed to when [fd] becomes available for [op]. *) @@ -149,10 +149,10 @@ val handle_signal : int -> unit {[ open Picos + open Picos_io open Picos_std_event open Picos_std_finally open Picos_std_structured - open Picos_stdio ]} {2 One of many} @@ -201,19 +201,19 @@ val handle_signal : int -> unit Flock.fork begin fun () -> while true do Event.select [ - Picos_stdio_select.on msg_inn1 `R + Picos_io_select.on msg_inn1 `R |> Event.map begin fun () -> print_endline "Inn1"; read1 msg_inn1; write1 syn_out end; - Picos_stdio_select.on msg_inn2 `R + Picos_io_select.on msg_inn2 `R |> Event.map begin fun () -> print_endline "Inn2"; read1 msg_inn2; write1 syn_out; end; - Picos_stdio_select.timeout + Picos_io_select.timeout ~seconds:60.0 |> Event.map begin fun () -> print_endline "Timeout"; diff --git a/lib/picos_io.thread_atomic/dune b/lib/picos_io.thread_atomic/dune new file mode 100644 index 00000000..b5d2f0fd --- /dev/null +++ b/lib/picos_io.thread_atomic/dune @@ -0,0 +1,3 @@ +(library + (name picos_io_thread_atomic) + (package picos_io)) diff --git a/lib/picos_stdio.thread_atomic/picos_stdio_thread_atomic.ml b/lib/picos_io.thread_atomic/picos_io_thread_atomic.ml similarity index 100% rename from lib/picos_stdio.thread_atomic/picos_stdio_thread_atomic.ml rename to lib/picos_io.thread_atomic/picos_io_thread_atomic.ml diff --git a/lib/picos_stdio.thread_atomic/picos_stdio_thread_atomic.mli b/lib/picos_io.thread_atomic/picos_io_thread_atomic.mli similarity index 100% rename from lib/picos_stdio.thread_atomic/picos_stdio_thread_atomic.mli rename to lib/picos_io.thread_atomic/picos_io_thread_atomic.mli diff --git a/lib/picos_stdio/dune b/lib/picos_io/dune similarity index 64% rename from lib/picos_stdio/dune rename to lib/picos_io/dune index 848f8ea9..d5c5d9c7 100644 --- a/lib/picos_stdio/dune +++ b/lib/picos_io/dune @@ -1,13 +1,13 @@ (library - (name picos_stdio) - (public_name picos_stdio) + (name picos_io) + (public_name picos_io) (root_module Deps) (libraries - (re_export unix) - (re_export picos_stdio_fd) (re_export picos) + (re_export picos_io_fd) + (re_export unix) picos_aux.htbl - picos_stdio.select)) + picos_io.select)) (mdx (package picos_meta) @@ -15,13 +15,13 @@ (>= %{ocaml_version} 5.1.0)) (libraries picos + picos_io picos_mux.random picos_std.finally picos_std.structured - picos_stdio unix) - (files picos_stdio.mli)) + (files picos_io.mli)) (documentation - (package picos_stdio) + (package picos_io) (mld_files index)) diff --git a/lib/picos_stdio/index.mld b/lib/picos_io/index.mld similarity index 85% rename from lib/picos_stdio/index.mld rename to lib/picos_io/index.mld index e6728fc9..fe4ecd40 100644 --- a/lib/picos_stdio/index.mld +++ b/lib/picos_io/index.mld @@ -3,9 +3,9 @@ This package provides an asynchronous IO system for {!Picos}. {!modules: - Picos_stdio - Picos_stdio_select - Picos_stdio_fd + Picos_io + Picos_io_select + Picos_io_fd } {^ The IO libraries in this package are currently built only on top of the diff --git a/lib/picos_stdio/picos_stdio.ml b/lib/picos_io/picos_io.ml similarity index 99% rename from lib/picos_stdio/picos_stdio.ml rename to lib/picos_io/picos_io.ml index 3e84af76..56c06728 100644 --- a/lib/picos_stdio/picos_stdio.ml +++ b/lib/picos_io/picos_io.ml @@ -1,6 +1,6 @@ open Picos -module Select = Picos_stdio_select -module Fd = Picos_stdio_fd +module Select = Picos_io_select +module Fd = Picos_io_fd module Htbl = Picos_aux_htbl let nonblock_fds = Htbl.create ~hashed_type:(module Fd.Resource) () diff --git a/lib/picos_stdio/picos_stdio.mli b/lib/picos_io/picos_io.mli similarity index 98% rename from lib/picos_stdio/picos_stdio.mli rename to lib/picos_io/picos_io.mli index ee367fe7..d519b12e 100644 --- a/lib/picos_stdio/picos_stdio.mli +++ b/lib/picos_io/picos_io.mli @@ -38,13 +38,13 @@ module Unix : sig Windows, scheduler friendly blocking only works properly with non-blocking file descriptors, i.e. sockets. - ⚠️ This module uses {!Picos_stdio_select} and you may need to - {{!Picos_stdio_select.configure} configure} it at start of your application. + ⚠️ This module uses {!Picos_io_select} and you may need to + {{!Picos_io_select.configure} configure} it at start of your application. Please consult the documentation of the {{!Deps.Unix} [Unix]} module that comes with OCaml. *) - type file_descr = Picos_stdio_fd.t + type file_descr = Picos_io_fd.t (** Opaque type alias for {{!Deps.Unix.file_descr} [Unix.file_descr]}. ⚠️ Please consider the reference counting of file descriptors as an @@ -350,10 +350,10 @@ module Unix : sig float -> file_descr list * file_descr list * file_descr list (** [select rds wrs exs timeout] is like {!Deps.Unix.select}, but uses - {!Picos_stdio_select} to avoid blocking the thread. + {!Picos_io_select} to avoid blocking the thread. 🐌 You may find composing multi file descriptor awaits via other means - with {!Picos_stdio_select} more flexible and efficient. *) + with {!Picos_io_select} more flexible and efficient. *) type lock_command = Unix.lock_command = | F_ULOCK @@ -689,9 +689,9 @@ end First we open some modules for convenience: {[ + open Picos_io open Picos_std_finally open Picos_std_structured - open Picos_stdio ]} {2 A pair of pipes} diff --git a/lib/picos_stdio_cohttp/dune b/lib/picos_io_cohttp/dune similarity index 66% rename from lib/picos_stdio_cohttp/dune rename to lib/picos_io_cohttp/dune index 5f110c5c..36703da4 100644 --- a/lib/picos_stdio_cohttp/dune +++ b/lib/picos_io_cohttp/dune @@ -1,9 +1,9 @@ (library - (name picos_stdio_cohttp) - (public_name picos_stdio_cohttp) + (name picos_io_cohttp) + (public_name picos_io_cohttp) (libraries - (re_export picos_stdio) (re_export cohttp) + (re_export picos_io) (re_export uri) fmt picos_std.finally @@ -18,14 +18,14 @@ (libraries cohttp http + picos_io + picos_io_cohttp picos_mux.random picos_std.finally picos_std.structured - picos_stdio - picos_stdio_cohttp uri) - (files picos_stdio_cohttp.mli)) + (files picos_io_cohttp.mli)) (documentation - (package picos_stdio_cohttp) + (package picos_io_cohttp) (mld_files index)) diff --git a/lib/picos_io_cohttp/index.mld b/lib/picos_io_cohttp/index.mld new file mode 100644 index 00000000..7fbe7b96 --- /dev/null +++ b/lib/picos_io_cohttp/index.mld @@ -0,0 +1,8 @@ +{0 Cohttp running on Picos IO} + +This package provides a minimalistic {{:https://github.com/mirage/ocaml-cohttp/} +Cohttp} implementation for {!Picos} using {!Picos_io}. + +{!modules: + Picos_io_cohttp +} \ No newline at end of file diff --git a/lib/picos_stdio_cohttp/picos_stdio_cohttp.ml b/lib/picos_io_cohttp/picos_io_cohttp.ml similarity index 99% rename from lib/picos_stdio_cohttp/picos_stdio_cohttp.ml rename to lib/picos_io_cohttp/picos_io_cohttp.ml index 9e5361ef..1122fe78 100644 --- a/lib/picos_stdio_cohttp/picos_stdio_cohttp.ml +++ b/lib/picos_io_cohttp/picos_io_cohttp.ml @@ -1,6 +1,6 @@ +open Picos_io open Picos_std_finally open Picos_std_structured -open Picos_stdio (* *) diff --git a/lib/picos_stdio_cohttp/picos_stdio_cohttp.mli b/lib/picos_io_cohttp/picos_io_cohttp.mli similarity index 96% rename from lib/picos_stdio_cohttp/picos_stdio_cohttp.mli rename to lib/picos_io_cohttp/picos_io_cohttp.mli index 6f7f9fcf..43a9cc47 100644 --- a/lib/picos_stdio_cohttp/picos_stdio_cohttp.mli +++ b/lib/picos_io_cohttp/picos_io_cohttp.mli @@ -1,10 +1,10 @@ (** Minimalistic {{:https://github.com/mirage/ocaml-cohttp/} Cohttp} - implementation using {!Picos_stdio} for {!Picos}. + implementation using {!Picos_io} for {!Picos}. ⚠️ This library is currently minimalistic and experimental and is highly likely to change. Feedback from potential users is welcome! *) -open Picos_stdio +open Picos_io (** {1 Modules} *) @@ -42,10 +42,10 @@ end {[ open Cohttp + open Picos_io + open Picos_io_cohttp open Picos_std_finally open Picos_std_structured - open Picos_stdio - open Picos_stdio_cohttp ]} {2 A server and client} @@ -71,7 +71,7 @@ end The reason for doing it like this, as we'll see later, is that we want the OS to decide the port for our server. Also note that we explicitly set the - socket to non-blocking mode, which is what we should do with {!Picos_stdio} + socket to non-blocking mode, which is what we should do with {!Picos_io} whenever possible. Then we'll define a function that runs a server given a socket: diff --git a/lib/picos_mux.fifo/dune b/lib/picos_mux.fifo/dune index 79d35022..011bc02e 100644 --- a/lib/picos_mux.fifo/dune +++ b/lib/picos_mux.fifo/dune @@ -8,7 +8,7 @@ (select select.ml from - (picos_stdio.select -> select.some.ml) + (picos_io.select -> select.some.ml) (-> select.none.ml)) multicore-magic picos_aux.mpscq)) diff --git a/lib/picos_mux.fifo/picos_mux_fifo.mli b/lib/picos_mux.fifo/picos_mux_fifo.mli index 3ed47058..fde6279c 100644 --- a/lib/picos_mux.fifo/picos_mux_fifo.mli +++ b/lib/picos_mux.fifo/picos_mux_fifo.mli @@ -14,9 +14,9 @@ ℹ️ This scheduler implementation is mostly meant as an example and for use in testing libraries implemented in {!Picos}. - ⚠️ This scheduler uses {!Picos_stdio_select} internally. If running multiple - threads that each run this scheduler, {!Picos_stdio_select.configure} must - be called by the main thread before creating other threads. *) + ⚠️ This scheduler uses {!Picos_io_select} internally. If running multiple + threads that each run this scheduler, {!Picos_io_select.configure} must be + called by the main thread before creating other threads. *) open Picos diff --git a/lib/picos_mux.fifo/select.none.ml b/lib/picos_mux.fifo/select.none.ml index b3df07ed..4677ae79 100644 --- a/lib/picos_mux.fifo/select.none.ml +++ b/lib/picos_mux.fifo/select.none.ml @@ -1,4 +1,4 @@ let cancel_after _ ~seconds:_ _ = - raise (Sys_error "Computation: cancel_after unavailable; install picos_stdio") + raise (Sys_error "Computation: cancel_after unavailable; install picos_io") let check_configured = Fun.id diff --git a/lib/picos_mux.fifo/select.some.ml b/lib/picos_mux.fifo/select.some.ml index e4981d36..e099437d 100644 --- a/lib/picos_mux.fifo/select.some.ml +++ b/lib/picos_mux.fifo/select.some.ml @@ -1,2 +1,2 @@ -let cancel_after = Picos_stdio_select.cancel_after -let check_configured = Picos_stdio_select.check_configured +let cancel_after = Picos_io_select.cancel_after +let check_configured = Picos_io_select.check_configured diff --git a/lib/picos_mux.multififo/dune b/lib/picos_mux.multififo/dune index cdcafefd..5d49053e 100644 --- a/lib/picos_mux.multififo/dune +++ b/lib/picos_mux.multififo/dune @@ -8,7 +8,7 @@ (select select.ml from - (picos_stdio.select -> select.some.ml) + (picos_io.select -> select.some.ml) (-> select.none.ml)) multicore-magic picos.thread diff --git a/lib/picos_mux.multififo/picos_mux_multififo.mli b/lib/picos_mux.multififo/picos_mux_multififo.mli index 3b5ef6ab..65ce7b65 100644 --- a/lib/picos_mux.multififo/picos_mux_multififo.mli +++ b/lib/picos_mux.multififo/picos_mux_multififo.mli @@ -15,9 +15,9 @@ ℹ️ This scheduler implementation is mostly meant as an example and for use in testing libraries implemented in {!Picos}. - ⚠️ This scheduler uses {!Picos_stdio_select} internally. If running multiple - threads that each run this scheduler, {!Picos_stdio_select.configure} must - be called by the main thread before creating other threads. *) + ⚠️ This scheduler uses {!Picos_io_select} internally. If running multiple + threads that each run this scheduler, {!Picos_io_select.configure} must be + called by the main thread before creating other threads. *) open Picos diff --git a/lib/picos_mux.multififo/select.none.ml b/lib/picos_mux.multififo/select.none.ml index b3df07ed..4677ae79 100644 --- a/lib/picos_mux.multififo/select.none.ml +++ b/lib/picos_mux.multififo/select.none.ml @@ -1,4 +1,4 @@ let cancel_after _ ~seconds:_ _ = - raise (Sys_error "Computation: cancel_after unavailable; install picos_stdio") + raise (Sys_error "Computation: cancel_after unavailable; install picos_io") let check_configured = Fun.id diff --git a/lib/picos_mux.multififo/select.some.ml b/lib/picos_mux.multififo/select.some.ml index e4981d36..e099437d 100644 --- a/lib/picos_mux.multififo/select.some.ml +++ b/lib/picos_mux.multififo/select.some.ml @@ -1,2 +1,2 @@ -let cancel_after = Picos_stdio_select.cancel_after -let check_configured = Picos_stdio_select.check_configured +let cancel_after = Picos_io_select.cancel_after +let check_configured = Picos_io_select.check_configured diff --git a/lib/picos_mux.random/dune b/lib/picos_mux.random/dune index dac7f585..9d3ac0d7 100644 --- a/lib/picos_mux.random/dune +++ b/lib/picos_mux.random/dune @@ -8,7 +8,7 @@ (select select.ml from - (picos_stdio.select -> select.some.ml) + (picos_io.select -> select.some.ml) (-> select.none.ml)) multicore-magic picos.thread diff --git a/lib/picos_mux.random/picos_mux_random.mli b/lib/picos_mux.random/picos_mux_random.mli index e35fe0e7..b4d3173c 100644 --- a/lib/picos_mux.random/picos_mux_random.mli +++ b/lib/picos_mux.random/picos_mux_random.mli @@ -4,9 +4,9 @@ ℹ️ This scheduler implementation is specifically intended for testing libraries implemented in Picos. - ⚠️ This scheduler uses {!Picos_stdio_select} internally. If running multiple - threads that each run this scheduler, {!Picos_stdio_select.configure} must - be called by the main thread before creating other threads. + ⚠️ This scheduler uses {!Picos_io_select} internally. If running multiple + threads that each run this scheduler, {!Picos_io_select.configure} must be + called by the main thread before creating other threads. {!Picos} is an interface that allows schedulers to make scheduling decisions freely. After each effect this scheduler picks the next fiber to run diff --git a/lib/picos_mux.random/select.none.ml b/lib/picos_mux.random/select.none.ml index b3df07ed..4677ae79 100644 --- a/lib/picos_mux.random/select.none.ml +++ b/lib/picos_mux.random/select.none.ml @@ -1,4 +1,4 @@ let cancel_after _ ~seconds:_ _ = - raise (Sys_error "Computation: cancel_after unavailable; install picos_stdio") + raise (Sys_error "Computation: cancel_after unavailable; install picos_io") let check_configured = Fun.id diff --git a/lib/picos_mux.random/select.some.ml b/lib/picos_mux.random/select.some.ml index e4981d36..e099437d 100644 --- a/lib/picos_mux.random/select.some.ml +++ b/lib/picos_mux.random/select.some.ml @@ -1,2 +1,2 @@ -let cancel_after = Picos_stdio_select.cancel_after -let check_configured = Picos_stdio_select.check_configured +let cancel_after = Picos_io_select.cancel_after +let check_configured = Picos_io_select.check_configured diff --git a/lib/picos_mux.thread/dune b/lib/picos_mux.thread/dune index 8f24cb19..82500e50 100644 --- a/lib/picos_mux.thread/dune +++ b/lib/picos_mux.thread/dune @@ -7,6 +7,6 @@ (select select.ml from - (picos_stdio.select -> select.some.ml) + (picos_io.select -> select.some.ml) (-> select.none.ml)) threads.posix)) diff --git a/lib/picos_mux.thread/picos_mux_thread.mli b/lib/picos_mux.thread/picos_mux_thread.mli index a61d1f2c..46e45198 100644 --- a/lib/picos_mux.thread/picos_mux_thread.mli +++ b/lib/picos_mux.thread/picos_mux_thread.mli @@ -3,22 +3,10 @@ ℹ️ This scheduler implementation is mostly meant as an example and for use in testing libraries implemented in {!Picos}. - ⚠️ This scheduler uses {!Picos_stdio_select} internally. If running multiple - threads that each run this scheduler, {!Picos_stdio_select.configure} must be + ⚠️ This scheduler uses {!Picos_io_select} internally. If running multiple + threads that each run this scheduler, {!Picos_io_select.configure} must be called by the main thread before creating other threads. - Briefly: - - - {{!Picos.Fiber.current} [current]} returns the current fiber from the per - thread state. - - {{!Picos.Fiber.spawn} [spawn]} creates a new {!Thread} for each fiber. - - {{!Picos.Fiber.yield} [yield]} just calls {!Thread.yield}. - - {{!Picos.Computation.cancel_after} [cancel_after]} uses a per-domain - {{!Picos_stdio_select} background thread} that runs a {!Unix.select} loop to - cancel computations. - - {{!Picos.Trigger.await} [await]} uses a per thread mutex and condition to - suspend the thread. - ⚠️ This scheduler is probably suitable for simple applications that do not spawn a lot of fibers. If an application uses a lot of short lived fibers, then a more sophisticated scheduler implementation using some sort of thread diff --git a/lib/picos_mux.thread/select.none.ml b/lib/picos_mux.thread/select.none.ml index b3df07ed..4677ae79 100644 --- a/lib/picos_mux.thread/select.none.ml +++ b/lib/picos_mux.thread/select.none.ml @@ -1,4 +1,4 @@ let cancel_after _ ~seconds:_ _ = - raise (Sys_error "Computation: cancel_after unavailable; install picos_stdio") + raise (Sys_error "Computation: cancel_after unavailable; install picos_io") let check_configured = Fun.id diff --git a/lib/picos_mux.thread/select.some.ml b/lib/picos_mux.thread/select.some.ml index e4981d36..e099437d 100644 --- a/lib/picos_mux.thread/select.some.ml +++ b/lib/picos_mux.thread/select.some.ml @@ -1,2 +1,2 @@ -let cancel_after = Picos_stdio_select.cancel_after -let check_configured = Picos_stdio_select.check_configured +let cancel_after = Picos_io_select.cancel_after +let check_configured = Picos_io_select.check_configured diff --git a/lib/picos_std.event/picos_std_event.mli b/lib/picos_std.event/picos_std_event.mli index 506db1f1..c54631c8 100644 --- a/lib/picos_std.event/picos_std_event.mli +++ b/lib/picos_std.event/picos_std_event.mli @@ -7,7 +7,7 @@ module Event : sig offer or request that might be accepted or succeed, but is cancelable if some other event happens first. - See the {!Picos_stdio_select} library for an example. + See the {!Picos_io_select} library for an example. ℹ️ This module intentionally mimics the {{:https://ocaml.org/manual/5.2/api/Event.html} [Event]} module provided diff --git a/lib/picos_std.finally/dune b/lib/picos_std.finally/dune index fedc18f9..550ec986 100644 --- a/lib/picos_std.finally/dune +++ b/lib/picos_std.finally/dune @@ -6,9 +6,9 @@ (mdx (package picos_meta) (libraries + picos_io picos_std.finally picos_std.structured picos_std.sync - picos_stdio unix) (files picos_std_finally.mli)) diff --git a/lib/picos_std.finally/picos_std_finally.mli b/lib/picos_std.finally/picos_std_finally.mli index 208d6537..b8d4f3b5 100644 --- a/lib/picos_std.finally/picos_std_finally.mli +++ b/lib/picos_std.finally/picos_std_finally.mli @@ -6,10 +6,10 @@ We open both this library and a few other libraries {[ + open Picos_io open Picos_std_finally open Picos_std_structured open Picos_std_sync - open Picos_stdio ]} for the examples. *) diff --git a/lib/picos_std.structured/dune b/lib/picos_std.structured/dune index 3d8bd862..fc6e5764 100644 --- a/lib/picos_std.structured/dune +++ b/lib/picos_std.structured/dune @@ -14,12 +14,12 @@ (>= %{ocaml_version} 5.0.0) (= %{env:OPAM_REPO_CI=false} false))) (libraries - picos_mux.random + picos_io picos_mux.fifo + picos_mux.random picos_std.event picos_std.finally picos_std.structured picos_std.sync - picos_stdio unix) (files picos_std_structured.mli)) diff --git a/lib/picos_std.structured/picos_std_structured.mli b/lib/picos_std.structured/picos_std_structured.mli index a62b4cf7..b17239ca 100644 --- a/lib/picos_std.structured/picos_std_structured.mli +++ b/lib/picos_std.structured/picos_std_structured.mli @@ -6,11 +6,11 @@ For the {{!examples} examples} we open some modules: {[ + open Picos_io open Picos_std_event open Picos_std_finally open Picos_std_structured open Picos_std_sync - open Picos_stdio ]} *) open Picos_std_event @@ -95,8 +95,8 @@ module Control : sig | exception Control.Terminate -> None ]} - or one could try to {{!Picos_stdio.Unix.connect} [connect]} a socket with - a timeout + or one could try to {{!Picos_io.Unix.connect} [connect]} a socket with a + timeout {[ let try_connect_in ~seconds socket sockaddr = @@ -108,7 +108,7 @@ module Control : sig | exception Control.Terminate -> false ]} - using the {!Picos_stdio.Unix} module. + using the {!Picos_io.Unix} module. The optional [callstack] argument specifies the number of callstack entries to capture with the {{!Control.Terminate} [Terminate]} exception. @@ -474,8 +474,8 @@ end First of all, note that above the {{!Picos_std_sync.Mutex} [Mutex]}, {{!Picos_std_sync.Condition} [Condition]}, and {{!Picos_std_sync.Semaphore} [Semaphore]} modules come from the {!Picos_std_sync} library and the - {{!Picos_stdio.Unix} [Unix]} module comes from the {!Picos_stdio} library. - They do not come from the standard OCaml libraries. + {{!Picos_io.Unix} [Unix]} module comes from the {!Picos_io} library. They + do not come from the standard OCaml libraries. The above program creates a {{!Flock} flock} of fibers and {{!Flock.fork} forks} several fibers to the flock that all block in various ways. In @@ -497,8 +497,8 @@ end incremental variable is never filled, - {{!Picos_std_sync.Stream.read} [Stream.read]} never returns, because the stream is never pushed to, - - {{!Picos_stdio.Unix.read} [Unix.read]} never returns, because the socket - is never written to, and the + - {{!Picos_io.Unix.read} [Unix.read]} never returns, because the socket is + never written to, and the - {!Control.sleep} call would return only after about a month. Fibers forked to a flock can be canceled in various ways. In the above diff --git a/lib/picos_stdio.thread_atomic/dune b/lib/picos_stdio.thread_atomic/dune deleted file mode 100644 index 1279bb68..00000000 --- a/lib/picos_stdio.thread_atomic/dune +++ /dev/null @@ -1,3 +0,0 @@ -(library - (name picos_stdio_thread_atomic) - (package picos_stdio)) diff --git a/lib/picos_stdio_cohttp/index.mld b/lib/picos_stdio_cohttp/index.mld deleted file mode 100644 index 8e92b4af..00000000 --- a/lib/picos_stdio_cohttp/index.mld +++ /dev/null @@ -1,8 +0,0 @@ -{0 Cohttp running on Picos stdio} - -This package provides a minimalistic {{:https://github.com/mirage/ocaml-cohttp/} -Cohttp} implementation for {!Picos} using {!Picos_stdio}. - -{!modules: - Picos_stdio_cohttp -} \ No newline at end of file diff --git a/picos_stdio.opam b/picos_io.opam similarity index 100% rename from picos_stdio.opam rename to picos_io.opam diff --git a/picos_stdio_cohttp.opam b/picos_io_cohttp.opam similarity index 90% rename from picos_stdio_cohttp.opam rename to picos_io_cohttp.opam index 135e0fe8..3be37153 100644 --- a/picos_stdio_cohttp.opam +++ b/picos_io_cohttp.opam @@ -1,7 +1,7 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" version: "dev" -synopsis: "Cohttp running on Picos stdio" +synopsis: "Cohttp running on Picos IO" maintainer: ["Vesa Karvonen "] authors: ["Vesa Karvonen "] license: "ISC" @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/picos" bug-reports: "https://github.com/ocaml-multicore/picos/issues" depends: [ "dune" {>= "3.14"} - "picos_stdio" {= version} + "picos_io" {= version} "cohttp" {>= "6.0.0~beta2"} "fmt" {>= "0.9.0"} "uri" {>= "4.4.0"} diff --git a/picos_meta.opam b/picos_meta.opam index 813453df..c24f55b8 100644 --- a/picos_meta.opam +++ b/picos_meta.opam @@ -12,8 +12,8 @@ depends: [ "picos" {= version} "picos_aux" {= version} "picos_std" {= version} - "picos_stdio" {= version} - "picos_stdio_cohttp" {= version} + "picos_io" {= version} + "picos_io_cohttp" {= version} "picos_mux" {= version} "picos_lwt" {= version} "dscheck" {>= "0.4.0"} diff --git a/picos_mux.opam b/picos_mux.opam index f58fb7d6..eb7411af 100644 --- a/picos_mux.opam +++ b/picos_mux.opam @@ -16,7 +16,7 @@ depends: [ "odoc" {with-doc} ] depopts: [ - "picos_stdio" {= version} + "picos_io" {= version} ] build: [ ["dune" "subst"] {dev} diff --git a/test/dune b/test/dune index bdc1b8e3..c9536334 100644 --- a/test/dune +++ b/test/dune @@ -4,7 +4,7 @@ (modules test_scheduler) (libraries (re_export picos) - picos_stdio.select + picos_io.select (select test_scheduler.ml from @@ -95,48 +95,48 @@ (name test_server_and_client) (modules test_server_and_client) (libraries + picos_io picos_std.finally picos_std.structured picos_std.sync - picos_stdio test_scheduler)) ;; (test (package picos_meta) - (name test_stdio) - (modules test_stdio) + (name test_io) + (modules test_io) (libraries alcotest picos_aux.mpscq + picos_io picos_std.finally picos_std.structured - picos_stdio test_scheduler)) (test (package picos_meta) - (name test_stdio_cohttp) - (modules test_stdio_cohttp) + (name test_io_cohttp) + (modules test_io_cohttp) (libraries + picos_io_cohttp picos_std.finally picos_std.structured - picos_stdio_cohttp test_scheduler)) ;; (test (package picos_meta) - (name test_stdio_with_lwt) - (modules test_stdio_with_lwt) + (name test_io_with_lwt) + (modules test_io_with_lwt) (libraries alcotest lwt lwt.unix - picos_stdio - picos_stdio.select + picos_io + picos_io.select test_scheduler threads.posix)) @@ -149,10 +149,10 @@ (libraries alcotest domain_shims + picos_io.select picos_mux.thread picos_std.finally - picos_std.structured - picos_stdio.select)) + picos_std.structured)) ;; diff --git a/test/test_stdio.ml b/test/test_io.ml similarity index 96% rename from test/test_stdio.ml rename to test/test_io.ml index 3eb85018..b91e05e4 100644 --- a/test/test_stdio.ml +++ b/test/test_io.ml @@ -1,6 +1,6 @@ +open Picos_io open Picos_std_finally open Picos_std_structured -open Picos_stdio module Mpscq = Picos_aux_mpscq let test_system_unix () = @@ -16,9 +16,9 @@ let test_openfile_and_read () = Test_scheduler.run @@ fun () -> let@ fd = finally Unix.close @@ fun () -> - try Unix.openfile "test_stdio.ml" [ O_RDONLY ] 0o400 + try Unix.openfile "test_io.ml" [ O_RDONLY ] 0o400 with Unix.Unix_error (ENOENT, _, _) -> - Unix.openfile "test/test_stdio.ml" [ O_RDONLY ] 0o400 + Unix.openfile "test/test_io.ml" [ O_RDONLY ] 0o400 in let n = 10 in let bytes = Bytes.create n in @@ -138,4 +138,4 @@ let () = in common_cases @ if Sys.win32 then win32_cases else unix_cases ); ] - |> Alcotest.run "Picos_stdio" + |> Alcotest.run "Picos_io" diff --git a/test/test_stdio_cohttp.ml b/test/test_io_cohttp.ml similarity index 94% rename from test/test_stdio_cohttp.ml rename to test/test_io_cohttp.ml index 6b98fabe..88e9a9cc 100644 --- a/test/test_stdio_cohttp.ml +++ b/test/test_io_cohttp.ml @@ -1,8 +1,8 @@ open Cohttp +open Picos_io +open Picos_io_cohttp open Picos_std_finally open Picos_std_structured -open Picos_stdio -open Picos_stdio_cohttp let is_opam_ci = match Sys.getenv "OPAM_REPO_CI" with @@ -44,7 +44,7 @@ let main () = match Unix.getsockname server_socket with | ADDR_UNIX _ -> failwith "impossible" | ADDR_INET (addr, port) -> - Printf.sprintf "http://%s:%d/hello-stdio-cohttp" + Printf.sprintf "http://%s:%d/hello-io-cohttp" (Unix.string_of_inet_addr addr) port in diff --git a/test/test_stdio_with_lwt.ml b/test/test_io_with_lwt.ml similarity index 91% rename from test/test_stdio_with_lwt.ml rename to test/test_io_with_lwt.ml index 375f2ed4..3c30dc08 100644 --- a/test/test_stdio_with_lwt.ml +++ b/test/test_io_with_lwt.ml @@ -1,4 +1,4 @@ -open Picos_stdio +open Picos_io let test_system_unix () = let sleep = Lwt_unix.system "sleep 2" in @@ -19,4 +19,4 @@ let () = if Sys.win32 then [] else [ Alcotest.test_case "system" `Quick test_system_unix ] ); ] - |> Alcotest.run "Picos_stdio_with_lwt" + |> Alcotest.run "Picos_io_with_lwt" diff --git a/test/test_scheduler.ocaml4.ml b/test/test_scheduler.ocaml4.ml index 6c4ac63a..cee9bc67 100644 --- a/test/test_scheduler.ocaml4.ml +++ b/test/test_scheduler.ocaml4.ml @@ -4,7 +4,7 @@ let () = Random.self_init () open Picos let () = - Picos_stdio_select.check_configured (); + Picos_io_select.check_configured (); let[@alert "-handler"] rec propagate () = let computation = @@ -13,7 +13,7 @@ let () = Lwt_unix.handle_signal Sys.sigchld; propagate () in - Picos_stdio_select.return_on_sigchld computation () + Picos_io_select.return_on_sigchld computation () in propagate () diff --git a/test/test_scheduler.ocaml5.ml b/test/test_scheduler.ocaml5.ml index 7fa0e48e..e374ae68 100644 --- a/test/test_scheduler.ocaml5.ml +++ b/test/test_scheduler.ocaml5.ml @@ -4,7 +4,7 @@ let () = Random.self_init () open Picos let () = - Picos_stdio_select.check_configured (); + Picos_io_select.check_configured (); let[@alert "-handler"] rec propagate () = let computation = @@ -13,7 +13,7 @@ let () = Lwt_unix.handle_signal Sys.sigchld; propagate () in - Picos_stdio_select.return_on_sigchld computation () + Picos_io_select.return_on_sigchld computation () in propagate () diff --git a/test/test_select.ml b/test/test_select.ml index 9a231c9f..8b572d17 100644 --- a/test/test_select.ml +++ b/test/test_select.ml @@ -1,7 +1,7 @@ open Picos_std_structured open Picos_std_finally -let () = Picos_stdio_select.configure () +let () = Picos_io_select.configure () let test_intr () = let@ inn, _out = @@ -16,11 +16,11 @@ let test_intr () = for _ = 1 to 10 do Flock.fork @@ fun () -> for _ = 1 to 1_000 do - let req = Picos_stdio_select.Intr.req ~seconds:0.000_001 in + let req = Picos_io_select.Intr.req ~seconds:0.000_001 in match Unix.read inn (Bytes.create 1) 0 1 with | _ -> assert false | exception Unix.Unix_error (EINTR, _, _) -> - Picos_stdio_select.Intr.clr req + Picos_io_select.Intr.clr req done done in diff --git a/test/test_server_and_client.ml b/test/test_server_and_client.ml index ccd880fc..e095abb9 100644 --- a/test/test_server_and_client.ml +++ b/test/test_server_and_client.ml @@ -1,6 +1,6 @@ +open Picos_io open Picos_std_finally open Picos_std_structured -open Picos_stdio open Picos_std_sync let is_ocaml4 = String.starts_with ~prefix:"4." Sys.ocaml_version