コード例 #1
0
ファイル: PingPong_Example.cs プロジェクト: KevM/Magnum
        public PingPongPlayer(string name)
        {
            _name = name;

            _queue.Run();
            _actorProxy = new PingPongPlayerProxy(this);
        }
コード例 #2
0
ファイル: PingPong_Example.cs プロジェクト: neouser99/Magnum
        public void PingPong(int count, IPingPongPlayer partner)
        {
            if (count == 0)
            {
                _watch.Stop();
                Trace.WriteLine(_name + ": done in " + _watch.ElapsedMilliseconds + "ms");

                return;
            }

            if (count%5000 == 0 || count%5000 == 1)
            {
                //Trace.WriteLine(_name + ": PingPong = " + pingPongParams.Count + " On Thread: " + Thread.CurrentThread.ManagedThreadId);
            }

            partner.PingPong(count - 1, _actorProxy);
        }
コード例 #3
0
ファイル: PingPong_Example.cs プロジェクト: jgsteeler/Magnum
        public void PingPong(int count, IPingPongPlayer partner)
        {
            if (count == 0)
            {
                _watch.Stop();
                Trace.WriteLine(_name + ": done in " + _watch.ElapsedMilliseconds + "ms");

                return;
            }

            if (count % 5000 == 0 || count % 5000 == 1)
            {
                //Trace.WriteLine(_name + ": PingPong = " + pingPongParams.Count + " On Thread: " + Thread.CurrentThread.ManagedThreadId);
            }

            partner.PingPong(count - 1, _actorProxy);
        }
コード例 #4
0
ファイル: PingPong_Example.cs プロジェクト: neouser99/Magnum
 public void Setup()
 {
     _jack = new PingPongPlayer("Jack").GetProxy();
     _jill = new PingPongPlayer("Jill").GetProxy();
 }
コード例 #5
0
ファイル: PingPong_Example.cs プロジェクト: neouser99/Magnum
 public void PingPong(int count, IPingPongPlayer partner)
 {
     _player._fiber.Enqueue(() => _player.PingPong(count, partner));
 }
コード例 #6
0
ファイル: PingPong_Example.cs プロジェクト: jgsteeler/Magnum
        public PingPongPlayer(string name)
        {
            _name = name;

            _actorProxy = new PingPongPlayerProxy(this);
        }
コード例 #7
0
ファイル: PingPong_Example.cs プロジェクト: jgsteeler/Magnum
 public void Setup()
 {
     _jack = new PingPongPlayer("Jack").GetProxy();
     _jill = new PingPongPlayer("Jill").GetProxy();
 }
コード例 #8
0
ファイル: PingPong_Example.cs プロジェクト: jgsteeler/Magnum
 public void PingPong(int count, IPingPongPlayer partner)
 {
     _player._fiber.Add(() => _player.PingPong(count, partner));
 }