-1
async def task():
    async def func():
            run 1000 milion calculations which nearly takes forever to run
            return something
    result = await func()

AT THE MOMENT when loop meets result = await function1(), it switches to another function, lets say function2, and put function1 a "pause" tag.

Question:

Does function1 run with loop, so parallelism function1 and loop run different threads here.

Or

function1 never run the calculation, needs loop goes back to function1 to run - But it doesn't make sense of as the explaination of this is, it waits the function1 to complete (which is pure calculations)

topic: So what is it? paraellelism or what? (This is not my question, question is up 2 lines there, this is conclusion)

Please do not answer if you don't have an answer if you just know how to run it or just pasting says it is concurrency one thread.

quamrana
  • 37,849
  • 12
  • 53
  • 71
NickDxxD
  • 9
  • 1
  • Do the answers to this [question](https://stackoverflow.com/questions/48020593/python-what-are-the-advantages-of-async-over-threads) help at all? – quamrana Aug 06 '23 at 07:31

0 Answers0