Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.CyclicBarrier


        System.out.println("-- [" + Thread.currentThread().getName() + "] " + msg);
    }


    public void testConcurrentJoins() throws Exception {
        start_connecting=new CyclicBarrier(NUM +1);
        connected=new CyclicBarrier(NUM +1);
        received_all_views=new CyclicBarrier(NUM +1);
        start_disconnecting=new CyclicBarrier(NUM +1);
        disconnected=new CyclicBarrier(NUM +1);

        long start, stop;

        //  create main channel - will be coordinator for JOIN requests
        channel=new JChannel(props);
View Full Code Here


        System.out.println("-- [" + Thread.currentThread().getName() + "] " + msg);
    }


    public void testConcurrentStartupAndMerging() throws Exception {
        start_connecting=new CyclicBarrier(NUM+1);
        received_all_views=new CyclicBarrier(NUM+1);
        start_disconnecting=new CyclicBarrier(NUM+1);
        disconnected=new CyclicBarrier(NUM+1);

        long start, stop;

        for(int i=0; i < threads.length; i++) {
            threads[i]=new MyThread(i);
View Full Code Here

        System.out.println("-- [" + Thread.currentThread().getName() + "] " + msg);
    }


    public void testConcurrentStartupAndMerging() throws Exception {
        all_disconnected=new CyclicBarrier(NUM+1);
        start_disconnecting=new CyclicBarrier(NUM+1);

        for(int i=0; i < threads.length; i++) {
            threads[i]=new MyThread(i);
            synchronized(threads[i]) {
                threads[i].start();
View Full Code Here

        try
        {
            ds = (DataSourceComponent)manager.lookup( DataSourceComponent.ROLE );

            m_connectionCount = 0;
            m_barrier = new CyclicBarrier( 11 );

            for( int i = 0; i < 10; i++ )
            {
                ( new Thread( new ConnectionThread( this, ds ) ) ).start();
            }
View Full Code Here

  }

  public void evaluate() throws IOException {
    Process proc = Runtime.getRuntime().exec(_command);

    _barrier = new CyclicBarrier(3 + ((_stdin != null) ? 1 : 0));

    PullerThread so =
      new PullerThread("STDOUT", proc.getInputStream(), _stdout);
    so.start();
View Full Code Here

  }

  public void evaluate() throws IOException {
    Process proc = Runtime.getRuntime().exec(_command);

    _barrier = new CyclicBarrier(3 + ((_stdin != null) ? 1 : 0));

    PullerThread so =
      new PullerThread("STDOUT", proc.getInputStream(), _stdout);
    so.start();
View Full Code Here

        try
        {
            ds = (DataSourceComponent)manager.lookup( DataSourceComponent.ROLE );

            m_connectionCount = 0;
            m_barrier = new CyclicBarrier( 11 );

            for( int i = 0; i < 10; i++ )
            {
                ( new Thread( new ConnectionThread( this, ds ) ) ).start();
            }
View Full Code Here

                else
                {
                    try
                    {
                        int concurrent = 100;
                        CyclicBarrier barrier = new CyclicBarrier( concurrent );
                        int cnt = Integer.parseInt( cntStr );
                        int average = Math.max( cnt / concurrent, 1 );

                        while( cnt > 0 )
                        {
View Full Code Here

    public void testConcurrentRequests() throws Exception {
       
        final int WORKERS = 100;
        final int MESSAGE_COUNT=10;
        final CyclicBarrier barrier = new CyclicBarrier(WORKERS);

        for( int i=0; i < WORKERS; i++ ) {               
       
            new Thread() {
                /**
                 * @see java.lang.Thread#run()
                 */
                public void run() {
                    try {
                        String text = "Hello World";
                        MarshalledObject object = client.createMarshalledObject();
                        object.set(text);
                        Msg msg = client.createMsg();
                        msg.pushMarshaledObject(object);
                               
                        barrier.barrier();
                       
                        for(int i=0; i < MESSAGE_COUNT; i++ )        
                            client.sendRequest(connectURI,msg);
                       
                       
View Full Code Here

        }
    }

    public void testConcurrentRequests() throws Exception {

        final CyclicBarrier barrier = new CyclicBarrier(WORKERS);

        for (int i = 0; i < WORKERS; i++) {

            new Thread() {
                /**
                 * @see java.lang.Thread#run()
                 */
                public void run() {
                    try {
                        barrier.barrier();

                        for (int i = 0; i < MESSAGE_COUNT; i++)
                            sp.sendDown(allocateDownPacket());

                    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.CyclicBarrier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.