public static void main(String[] args) {
                final A a = new A();
                for (int i = 0; i < 3; i++) {
                        new Thread() {
                                @Override
                                public void run() {
                                        while (true) {
                                                a.get();
                                        }
                                }
                        }.start();
                }

                for (int i = 0; i < 3; i++) {
                        new Thread() {
                                @Override
                                public void run() {
                                        while (true) {
                                                a.write();
                                        }
                                }
                        }.start();
                }
        }