Skip to content
Advertisement

Needs assistance with Async or Multithreading task

I’m new in parallel programming currently needs to run app as a background process which contains several tasks inside. Currently executing only do_something(), it blocks execution of do_something2(). Could please anyone explain me how to implement that? Should I use asyncio or something else? Thank you.

JavaScript

Advertisement

Answer

I think, however, you need to organize your code as follows so that each process has its own scheduler (I have also modified/rearranged the code so that each process ultimately terminates after some number of iterations for my testing purposes):

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement