Esempio n. 1
0
        public void i2()
        {
            DoParallel   d     = new DoParallel();
            IStack <int> stack = new IntStackWrapper(new LockfreeStack <int>());

            d.Add("t1", () => { stack.Push(1); stack.Push(2); });
            d.Add("t2", () => { int elt; stack.Pop(out elt); stack.Pop(out elt); });

            d.Execute();
        }
Esempio n. 2
0
        public void o1()
        {
            DoParallel    d     = new DoParallel();
            IStack <Flag> stack = new ObjStackWrapper <Flag>(new LockfreeStack <Flag>());

            d.Add("t1", () => { stack.Push(new Flag()); stack.Push(new Flag()); });
            d.Add("t2", () => { Flag elt; stack.Pop(out elt); stack.Pop(out elt); });

            d.Execute();
        }
Esempio n. 3
0
        public void i6()
        {
            DoParallel   d     = new DoParallel();
            IStack <int> stack = new IntStackWrapper(new LockfreeStack <int>());

            d.Add("t1", () => { stack.Push(1); });
            d.Add("t2", () => { stack.Push(2); });
            d.Add("t3", () => { int x = Chess.Choose(2) + 1; stack.Contains(x); });

            d.Execute();
        }