package moonpool

  1. Overview
  2. Docs
Pools of threads supported by a pool of domains

Install

dune-project
 Dependency

Authors

Maintainers

Sources

moonpool-0.10.tbz
sha256=6e3ddd37c8db9b2b7945031a72f716ba291753b1b212dd85af3cc1d62325375a
sha512=07e51249842078b08850506ff76800c4fc9185113a08b69c517fd3e6e561120dbd12a0aabd89518a540adf4d0711fd0785894595d2a3e39a799e764a427c25fc

doc/src/moonpool/moonpool.ml.html

Source file moonpool.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
open Types_

exception Shutdown = Runner.Shutdown

let start_thread_on_some_domain f x =
  let did = Random.int (Domain_pool_.max_number_of_domains ()) in
  Domain_pool_.run_on_and_wait did (fun () -> Thread.create f x)

let run_async = Runner.run_async
let run_wait_block = Runner.run_wait_block
let get_current_runner = Runner.get_current_runner
let recommended_thread_count () = Domain_.recommended_number ()
let spawn = Fut.spawn
let spawn_on_current_runner = Fut.spawn_on_current_runner
let await = Fut.await
let yield = Picos.Fiber.yield

module Atomic = Atomic
module Blocking_queue = Bb_queue
module Background_thread = Background_thread
module Chan = Chan
module Exn_bt = Exn_bt
module Fifo_pool = Fifo_pool
module Fut = Fut
module Lock = Lock
module Main = Main
module Immediate_runner = struct end
module Runner = Runner
module Task_local_storage = Task_local_storage
module Thread_local_storage = Thread_local_storage
module Trigger = Trigger
module Ws_pool = Ws_pool

(* re-export main *)
include Main

module Private = struct
  module Ws_deque_ = Ws_deque_
  module Worker_loop_ = Worker_loop_
  module Domain_ = Domain_
  module Tracing_ = Tracing_
  module Types_ = Types_

  let num_domains = Domain_pool_.max_number_of_domains
end