Sensiblewings47
Sensiblewings47

Reputation: 566

Python native features for parallel processing

This is an assignment I am working on.

I have been asked to write a sample parallel processing program using native python features. I can write the code but the problem is - even after searching I cannot find a native parallel programming feature in python.

Since we have to import "multiprocessing" module - it is not native. I just cannot find which feature is available to use.

Already checked following threads but they use multiprocessing:

Parallel programming in python

Python multiprocessing for parallel processes

How to do parallel programming in Python

Upvotes: 2

Views: 357

Answers (1)

Roland Smith
Roland Smith

Reputation: 43533

I think your definition of "native" is too narrow, or your understanding of the term "import" is mistaken.

The multiprocessing module is part of Python's standard library. Every Python implementation should have it. It is a native feature of Python.

The term "import" should be understood as "make this module available in this program", not as "add this non-native feature to the language". Importing a module does not change the language.

Edit:

In Python 3 you could make concurrent programs with async def and yield. But that shouldn't be considered real parallel processing. You might call it cooperative "multitasking", but it isn't really. It's task switching.

Upvotes: 3

Related Questions