Why parallel processing takes more time than sequential processing ?
I have a code, in that when you execute it in the parallel environment takes more time than in a sequential way. Here is the code https://code.sololearn.com/cCPep2DRYT3l/?ref=app [Code is just for reference, won't actually work on sololearn code playground ] -------------------------------------------------------------------------- Execution instruction - (Linux) For Parallel ~$g++ Bubble.cpp -fopenmp For Sequential ~$g++ Bubble.cpp Output: 1) For Parallel: Execution time is 26742 ms 2) For Sequential: Execution time is 14 ms [NOTE both gives correct output] -------------------------------------------------------------------------- Why is there a time delay? in parallel processing, it is expected that parallel processing will execute faster. but in actual practice, sequential is executing faster. What is the reason behind it?