aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorgareuselesinge2013-08-20 12:43:42 +0000
committergareuselesinge2013-08-20 12:43:42 +0000
commit16a2717d25096fcbd07b252e775b66b6fbb6d2bd (patch)
treeaa27bd74810dbda95b19097ea486842eb8f7e33a /kernel
parentc5b699f8feb54b7ada2cb6c6754a1909ebedcd3f (diff)
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
Diffstat (limited to 'kernel')
-rw-r--r--kernel/univ.ml4
-rw-r--r--kernel/univ.mli1
2 files changed, 4 insertions, 1 deletions
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