mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 11:15:38 -05:00
tweal to WS pool
This commit is contained in:
parent
08722691e8
commit
c044fb8fc9
1 changed files with 3 additions and 4 deletions
|
|
@ -98,7 +98,7 @@ exception Got_task of task
|
||||||
type around_task = AT_pair : (t -> 'a) * (t -> 'a -> unit) -> around_task
|
type around_task = AT_pair : (t -> 'a) * (t -> 'a -> unit) -> around_task
|
||||||
|
|
||||||
(** How many times in a row do we try to do work-stealing? *)
|
(** How many times in a row do we try to do work-stealing? *)
|
||||||
let steal_attempt_max_retry = 3
|
let steal_attempt_max_retry = 2
|
||||||
|
|
||||||
(** Main loop for a worker thread. *)
|
(** Main loop for a worker thread. *)
|
||||||
let worker_thread_ (self : state) (runner : t) (w : worker_state) ~on_exn
|
let worker_thread_ (self : state) (runner : t) (w : worker_state) ~on_exn
|
||||||
|
|
@ -157,9 +157,8 @@ let worker_thread_ (self : state) (runner : t) (w : worker_state) ~on_exn
|
||||||
| Some task ->
|
| Some task ->
|
||||||
run_task task;
|
run_task task;
|
||||||
raise_notrace Exit
|
raise_notrace Exit
|
||||||
| None ->
|
| None -> incr unsuccessful_steal_attempts
|
||||||
incr unsuccessful_steal_attempts;
|
(* Domain_.relax () *)
|
||||||
Domain_.relax ()
|
|
||||||
done;
|
done;
|
||||||
false
|
false
|
||||||
with Exit -> true
|
with Exit -> true
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue