I have a program that runs multiple tasklets using stackless python, and my problem is that though it is fast, I do notice a slowdown if I start one or more processes that run the same code.
For example, using threads inside the processes it takes my program 6 seconds to complete, and if I start 2 processes it still only takes 6 seconds to complete. But if I use tasklets the program only takes 2 seconds to complete, but then it takes 4 seconds if I run 2 processes simultaneously and 6 seconds if I run 3 processes and etc.
My question is, is this the normal behavior of stackless python? I checked to make sure the tasklets in the separate processes are using separate schedulers and each process can only see their tasklets, but maybe all the tasklets in all the processes are still fighting over system resources? It's the only explanation I can think of for why each additional process would cause a slowdown when using tasklets but not threads. I need someone to explain this to me so I can figure out if there's something wrong with my code or if this is an unavoidable issue.