N
N
nuclear_kote2018-07-03 16:43:06
Java
nuclear_kote, 2018-07-03 16:43:06

Is it possible to increase JNA throughput?

There is a sish method that gives an array of structures (about 6000 at a time, ~ 1kb each), the toad pulls it in several threads. as a result, approximately 3 Gb of data from C++ should come to the toad. Why is less than 1 Gbit coming. Changing the number of threads in toad does not give an improvement, just like changing the burst size in c++, the queue continues to grow at about the same rate. It seems that there is simply not enough bandwidth

for (int i = 0; i < 6; i++) {
            new Thread(() -> {
                while (true) {
                    StructContainer container = cLib.get();
                    if (container == null || container.size <= 0) {
                        continue;
                    }
                }
            }).start();

struct PacketArray getPacket() {
    struct PacketArray packetArray;
    if (!queue.try_dequeue(packetArray)) {
        packetArray.size = 0;
    }
    return packetArray;
}

on the c++ side, moodycamel::ConcurrentQueue is used.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question