future proofs: Future.fork_pri 1 minimizes queue length and pending promises
authorwenzelm
Tue Dec 16 18:04:16 2008 +0100 (2008-12-16)
changeset 29124ce6f21913e54
parent 29123 63c25d3964f7
child 29126 970d746274d5
future proofs: Future.fork_pri 1 minimizes queue length and pending promises
-- slight improvement of throughput, at the cost of a bit of parallelism;
src/Pure/Isar/toplevel.ML
src/Pure/goal.ML
     1.1 --- a/src/Pure/Isar/toplevel.ML	Tue Dec 16 16:25:20 2008 +0100
     1.2 +++ b/src/Pure/Isar/toplevel.ML	Tue Dec 16 18:04:16 2008 +0100
     1.3 @@ -718,7 +718,7 @@
     1.4  
     1.5          val future_proof = Proof.future_proof
     1.6            (fn prf =>
     1.7 -            Future.fork_pri ~1 (fn () =>
     1.8 +            Future.fork_pri 1 (fn () =>
     1.9                let val (states, State (result_node, _)) =
    1.10                  (case st' of State (SOME (Proof (_, (_, orig_gthy)), exit), prev)
    1.11                    => State (SOME (Proof (ProofNode.init prf, (finish, orig_gthy)), exit), prev))
     2.1 --- a/src/Pure/goal.ML	Tue Dec 16 16:25:20 2008 +0100
     2.2 +++ b/src/Pure/goal.ML	Tue Dec 16 18:04:16 2008 +0100
     2.3 @@ -179,7 +179,7 @@
     2.4      val res =
     2.5        if immediate orelse #maxidx (Thm.rep_cterm stmt) >= 0 orelse not (Future.enabled ())
     2.6        then result ()
     2.7 -      else future_result ctxt' (Future.fork_pri ~1 result) (Thm.term_of stmt);
     2.8 +      else future_result ctxt' (Future.fork_pri 1 result) (Thm.term_of stmt);
     2.9    in
    2.10      Conjunction.elim_balanced (length props) res
    2.11      |> map (Assumption.export false ctxt' ctxt)