Parcourir la source

Reduce the chance of a race_condition when updating the version of
compiled objects

Yentl Van Tendeloo il y a 8 ans
Parent
commit
7c7919fc29

Fichier diff supprimé car celui-ci est trop grand
+ 5861 - 5843
bootstrap/bootstrap.m


+ 5 - 3
bootstrap/compilation_manager.alc

@@ -16,7 +16,6 @@ Void function compilation_manager():
 	if (operation == "upload"):
 		object_name = input()
 		node = create_node()
-		dict_add(root, object_name, node)
 		dict_add(node, "hash_md5", input())
 		if (input()):
 			dict_add(node, "initializers", construct_top())
@@ -28,8 +27,11 @@ Void function compilation_manager():
 		dict_add(node, "symbols", symbols)
 		while (input()):
 			dict_add(symbols, input(), input())
-	elif (operation == "remove_obj"):
-		dict_delete(root, input())
+
+		if (dict_in(root, object_name)):
+			// Already exists, so remove first
+			dict_delete(root, object_name)
+		dict_add(root, object_name, node)
 	elif (operation == "read_initializers"):
 		node = root[input()]["initializers"]
 		output(node)

+ 0 - 3
interface/HUTN/hutn_compiler/primitives_object_visitor.py

@@ -42,9 +42,6 @@ class PrimitivesObjectVisitor(PrimitivesVisitor):
             # Is defined already, so let's compare hashes
             if v != self.hash_file:
                 print("[COMPILE] %s" % simple_filename)
-
-                # Remove in Modelverse and recompile
-                flush_data([3, "remove_obj", self.obj_file])
             else:
                 self.visit = lambda i: i
                 self.dump = lambda: True

+ 0 - 2
state/modelverse_state/main.py

@@ -98,8 +98,6 @@ class ModelverseState(object):
                             else:
                                 value = eval(value)
                             symbols[name], status = self.create_nodevalue(value)
-                            if name.endswith("initial_IP"):
-                                print("%s -- %s" % (name, symbols[name]))
                     elif element_type == "Edge":
                         values = [v.split()[0] for v in values.split(",")]
                         symbols[name], status = self.create_edge(resolve(values[0]), resolve(values[1]))