async io event loop an important point to note in the above description is that task does not give up the processor unless it decides tofor example by having to wait for something else they never get interrupted in the middle of an operationthis avoids the problem that two threads might have when being time sliced by separate scheduler as they may both be sharing the same resource this can greatly simplify your code the async and await keywords the async keywordintroduced in python is used to mark function as being something that uses the await keyword (we will come back to this below as there is one other use of the async keyworda function that uses the await keyword can be run as separate task and can give up control of the processor when it calls await against another async function and must wait for that function to complete the invoked async function can then run as separate task etc to invoke an async function it is necessary to start the async io event loop and for that function to be treated as task by the event loop this is done by calling the asyncio run(method and passing in the root async function the asyncio run(function was introduced in python (older versions of python such as python required you to explicitly obtain reference to the event loop and to run the root async function via thatone point to note about this function is that it has been marked as being provisional in python this means that future versions of python may or may not support the function or may modify the function in some way you should therefore check the documentation for the version of python you are using to see whether the run method has been altered or not using async and await we will examine very simple async io program from the top down the main(function for the program is given belowdef main(print('main starting'asyncio run(do_something()print('main done'if __name__ ='__main__'main(