Examples of BondVOInterface


Examples of net.openhft.collections.fromdocs.BondVOInterface

        playPingPong(shm, 4, 5, true, "PingPongLockLEFT");
    }

    static void playPingPong(SharedHashMap<String, BondVOInterface> shm, double _coupon, double _coupon2, boolean setFirst, final String desc) throws InterruptedException {
        BondVOInterface bond1 = newDirectReference(BondVOInterface.class);
        BondVOInterface bond2 = newDirectReference(BondVOInterface.class);
        BondVOInterface bond3 = newDirectReference(BondVOInterface.class);
        BondVOInterface bond4 = newDirectReference(BondVOInterface.class);

        shm.acquireUsing("369604101", bond1);
        shm.acquireUsing("369604102", bond2);
        shm.acquireUsing("369604103", bond3);
        shm.acquireUsing("369604104", bond4);
        System.out.printf("\n\n" + desc + ": Timing 1 x off-heap operations on " + shm.file() + "\n");
        if (setFirst) {
            bond1.setCoupon(_coupon);
            bond2.setCoupon(_coupon);
            bond3.setCoupon(_coupon);
            bond4.setCoupon(_coupon);
        }
        int timeToCallNanoTime = 30;
        int runs = 1000000;
        long[] timings = new long[runs];
        for (int j = 0; j < 10; j++) {
View Full Code Here

Examples of net.openhft.collections.fromdocs.BondVOInterface

        playPingPong(shm, +1, true, "PingPongAddLEFT");
    }

    static void playPingPong(SharedHashMap<String, BondVOInterface> shm, double add, boolean setFirst, final String desc) {
        BondVOInterface bond1 = newDirectReference(BondVOInterface.class);
        BondVOInterface bond2 = newDirectReference(BondVOInterface.class);
        BondVOInterface bond3 = newDirectReference(BondVOInterface.class);
        BondVOInterface bond4 = newDirectReference(BondVOInterface.class);

        shm.acquireUsing("369604101", bond1);
        shm.acquireUsing("369604102", bond2);
        shm.acquireUsing("369604103", bond3);
        shm.acquireUsing("369604104", bond4);
        System.out.printf("\n\n" + desc + ": Timing off-heap operations on /dev/shm/RDR_DIM_Mock\n");
        if (setFirst) {
            bond1.setCoupon(add);
            bond2.setCoupon(add);
            bond3.setCoupon(add);
            bond4.setCoupon(add);
        }
        int timeToCallNanoTime = 30;
        int runs = 1000000;
        long[] timings = new long[runs];
        for (int j = 0; j < 100; j++) {
            for (int i = 0; i < runs; i++) {
                long _start = System.nanoTime();
                bond1.addAtomicCoupon(add);
                bond2.addAtomicCoupon(add);
                bond3.addAtomicCoupon(add);
                bond4.addAtomicCoupon(add);
                timings[i] = (System.nanoTime() - _start - timeToCallNanoTime) / 4;
            }
            Arrays.sort(timings);
            System.out.printf("#%d:  atomic add coupon 50/90/99%%tile was %,d / %,d / %,d%n",
                    j, timings[runs / 2], timings[runs * 9 / 10], timings[runs * 99 / 100]);
View Full Code Here

Examples of net.openhft.collections.fromdocs.BondVOInterface

        playPingPong(shm, 4, 5, true, "PingPongCASLEFT");
    }

    static void playPingPong(SharedHashMap<String, BondVOInterface> shm, double _coupon, double _coupon2, boolean setFirst, final String desc) {
        BondVOInterface bond1 = newDirectReference(BondVOInterface.class);
        BondVOInterface bond2 = newDirectReference(BondVOInterface.class);
        BondVOInterface bond3 = newDirectReference(BondVOInterface.class);
        BondVOInterface bond4 = newDirectReference(BondVOInterface.class);

        shm.acquireUsing("369604101", bond1);
        shm.acquireUsing("369604102", bond2);
        shm.acquireUsing("369604103", bond3);
        shm.acquireUsing("369604104", bond4);
        System.out.printf("\n\n" + desc + ": Timing 1 x off-heap operations on /dev/shm/RDR_DIM_Mock\n");
        if (setFirst) {
            bond1.setCoupon(_coupon);
            bond2.setCoupon(_coupon);
            bond3.setCoupon(_coupon);
            bond4.setCoupon(_coupon);
        }
        int timeToCallNanoTime = 30;
        int runs = 1000000;
        long[] timings = new long[runs];
        for (int j = 0; j < 10; j++) {
            for (int i = 0; i < runs; i++) {
                long _start = System.nanoTime(); //
                while (!bond1.compareAndSwapCoupon(_coupon, _coupon2)) ;
                while (!bond2.compareAndSwapCoupon(_coupon, _coupon2)) ;
                while (!bond3.compareAndSwapCoupon(_coupon, _coupon2)) ;
                while (!bond4.compareAndSwapCoupon(_coupon, _coupon2)) ;

                timings[i] = (System.nanoTime() - _start - timeToCallNanoTime) / 4;
            }
            Arrays.sort(timings);
            System.out.printf("#%d:  compareAndSwapCoupon() 50/90/99%%tile was %,d / %,d / %,d%n",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.