Summary: These changes introduce the RestartScheduler which for now is a copy of the FileScheduler: - added it as a possible argument to the recently added `--scheduler` option. - made the necessary changes in `InferAnalyze` to call it if it was chosen. Reviewed By: ngorogiannis Differential Revision: D19373505 fbshipit-source-id: 98f065057master
parent
774223165c
commit
e6069f3ef7
@ -0,0 +1,22 @@
|
|||||||
|
(*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
open! IStd
|
||||||
|
|
||||||
|
(** This behaves exactly the same as the FileScheduler so far. The goal is that it will use a work
|
||||||
|
queue and proc locking to avoid repeating work and hopefully get some in process cache hits. *)
|
||||||
|
let make sources =
|
||||||
|
let gen =
|
||||||
|
List.rev_map sources ~f:(fun sf -> SchedulerTypes.File sf)
|
||||||
|
|> List.permute ~random_state:(Random.State.make (Array.create ~len:1 0))
|
||||||
|
|> ProcessPool.TaskGenerator.of_list
|
||||||
|
in
|
||||||
|
let next x =
|
||||||
|
let res = gen.next x in
|
||||||
|
(* see defn of gen above to see why res should never match Some (Procname _) *)
|
||||||
|
match res with None -> None | Some (Procname _) -> assert false | Some (File _) as v -> v
|
||||||
|
in
|
||||||
|
{gen with next}
|
@ -0,0 +1,9 @@
|
|||||||
|
(*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*)
|
||||||
|
open! IStd
|
||||||
|
|
||||||
|
val make : SourceFile.t list -> SchedulerTypes.target ProcessPool.TaskGenerator.t
|
Loading…
Reference in new issue