5 ms·
Python programs execute in sequence. No Fork/Join frameworks, no coroutines, no lightweight processes, nothing. Your Python code will execute in sequence if it
by xenophanes 16y ago
Python programs execute in sequence. No Fork/Join frameworks, no coroutines, no lightweight processes, nothing. Your Python code will execute in sequence if it lives in the same process space.
The answer from Brett and Guido to concurrency? Develop your code in C, or write your code to execute in multiple processes.
Could someone explain this to me? It says no fork/join to get concurrency, but then it says you can use multiple processes. Fork makes another process. I'm confused. What's a "process space"?
- fjh 16y agoIt says "no Fork/Join frameworks", not "no Fork/Join". You can definitely fork processes in Python: http://docs.python.org/library/os.html#os.fork http://docs.python.org/library/os.html#os.fork Using different processes allows you to execute code in parallel, but different processes can't access each other's memory, while threads within a process share their memory space and can therefore operate on the same data.
- xenophanes 16y agoIs there a different kind of fork that would make "fork/join frameworks" work?