mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
details in test
This commit is contained in:
parent
f5e94496f5
commit
039b08e810
1 changed files with 8 additions and 2 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
open Moonpool
|
||||
|
||||
let ( let@ ) = ( @@ )
|
||||
|
||||
let rec fib_direct x =
|
||||
if x <= 1 then
|
||||
1
|
||||
|
|
@ -18,7 +20,7 @@ let fib ~on x : int Fut.t =
|
|||
Fut.await t1 + Fut.await t2
|
||||
)
|
||||
in
|
||||
Fut.spawn ~on (fun () -> fib_rec x)
|
||||
Fut.spawn ~name:"fib" ~on (fun () -> fib_rec x)
|
||||
|
||||
(* NOTE: for tracy support
|
||||
let () = Tracy_client_trace.setup ()
|
||||
|
|
@ -46,9 +48,13 @@ let run_test () =
|
|||
|
||||
assert (res = Ok (Array.make 3 fib_40))
|
||||
|
||||
let () =
|
||||
let main () =
|
||||
(* now make sure we can do this with multiple pools in parallel *)
|
||||
let jobs = Array.init 2 (fun _ -> Thread.create run_test ()) in
|
||||
Array.iter Thread.join jobs
|
||||
|
||||
let () =
|
||||
let@ () = Trace_tef.with_setup () in
|
||||
main ()
|
||||
|
||||
[@@@endif]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue