4 ms·
I don't avoid multi threading, but I avoid the problems it causes using MPSC where multiple threads create remote procedure call events, put them on a single th
by nurettin 5y ago
I don't avoid multi threading, but I avoid the problems it causes using MPSC where multiple threads create remote procedure call events, put them on a single threadsafe queue and the main thread consumes them in batches.
If you want to know how much this effects your program, just start a few threads that produce dummy procedure calls and measure the time it takes to perform them all on your main thread. It will usually be on the order of millions per second. Then compare it with calling the procedures from those threads, but introduce mutexes instead of queues.