Thanks for replying but your answer doesn't answer the other question. For instance there's a method which will send a message to a specific native messaging host:
void send_message(const std::string& message) {...}
And there are a couple of threads which will use that method to send data which could be in the range 0-1 MB and they could send those data at any time. Let's assume there are 5 threads which will parallely send message to a specific native messaging host at the same time:
Thread 1 calls send_message with 100 KB of data
Thread 2 calls send_message with 300 KB of data
Thread 3 calls send_message with 400 KB of data
Thread 4 calls send_message with 600 KB of data
Thread 5 calls send_message with 800 KB of data
Now will Chromium read read all of those data sequentially or parallely? I tried to find it out by debugging but I still can't reach a conclusion.
I have noticed there's a bug that's very hard to replicate when sending huge chunk of data parallely to native messaging host. Even though we have limited this JSON data (which includes binary data encoded in base64 so that we could send those data in JSON format) to 1 MB, Chromium will rarely report it was trying to send x GB of data, even though it's always less than 1 MB because of the default native message host limitation. I did try to debug that issue but have not been able to fix it as it rarely happens on some of our users' machine. This is what happens at that specific time: The contents of memory where 32-bit length of data is initially stored in Chromium will different at that time, than what was sent before sending the actually JSON serialized data. It gets overwritten, not sure why. So I am guessing it's most probably because of the above mentioned scenario?