large refactoring, ready to move away from rally
diff --git a/utils.py b/utils.py
new file mode 100644
index 0000000..8941ca5
--- /dev/null
+++ b/utils.py
@@ -0,0 +1,17 @@
+import multiprocessing
+
+
+def get_barrier(count):
+    val = multiprocessing.Value('i', count)
+    cond = multiprocessing.Condition()
+
+    def closure(timeout):
+        with cond:
+            val.value -= 1
+            if val.value == 0:
+                cond.notify_all()
+            else:
+                cond.wait(timeout)
+            return val.value == 0
+
+    return closure