From 16a2717d25096fcbd07b252e775b66b6fbb6d2bd Mon Sep 17 00:00:00 2001 From: gareuselesinge Date: Tue, 20 Aug 2013 12:43:42 +0000 Subject: Universe counters on slaves are in sync with master Simple framework for remote counters. The slaves ask the master for a fresh value. On the master the thread manager answers with a bunch of fresh values (so that further requests can be immediately satisfied). Remote counters are guarded with a mutex on the master, because all slave managers as well as the master thread can access the counter at the same time. I know the name sucks. These counters are remote for the slaves, and local for the master. I'm open to suggestions... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16713 85f007b7-540e-0410-9357-904b9bb8a0f7 --- kernel/univ.ml | 4 +++- kernel/univ.mli | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/univ.ml b/kernel/univ.ml index e6752bb9eb..ce9d9c4192 100644 --- a/kernel/univ.ml +++ b/kernel/univ.ml @@ -851,7 +851,9 @@ let fresh_level = let n = ref 0 in fun () -> incr n; UniverseLevel.Level (!n, Names.DirPath.empty) -let fresh_local_univ () = Atom (fresh_level ()) +let fresh_local_univ, set_remote_fresh_local_univ = + RemoteCounter.new_counter 0 ~incr:((+) 1) + ~build:(fun n -> Atom (UniverseLevel.Level (n, Names.DirPath.empty))) (* Miscellaneous functions to remove or test local univ assumed to occur only in the le constraints *) diff --git a/kernel/univ.mli b/kernel/univ.mli index 6b64ca8e47..7511769c41 100644 --- a/kernel/univ.mli +++ b/kernel/univ.mli @@ -129,6 +129,7 @@ val sort_universes : universes -> universes (** {6 Support for sort-polymorphic inductive types } *) val fresh_local_univ : unit -> universe +val set_remote_fresh_local_univ : universe RemoteCounter.installer val solve_constraints_system : universe option array -> universe array -> universe array -- cgit v1.2.3