I am implementing two algotihms that run in a multi-agent framework, so each agent should run the algorithm. The first algorithm is sequential, each agent should wait for the previous one, but the second one is concurrent.
I implemented both with threads and the running time is more or less the same for both compared with the serial case(for the sequential was expected but not for the concurrent one). I changed the code to use processes and the time is 20x slower for both algorithms. Is this normal?
Edit 1: the idea of the algorithm is that each agent run it concurrently, then return parameters from the algorithm to the main program to compute the average. This average is used for the next iteration of the algorithm and so on... The return of the parameters, which i am doing with a multiprocessing queue, could be the problem of the slow time?