human
I am working on the file "04-concurrency/mutial_exclusion.ipynb".
The first task is:
Unlike threading, multiprocessing is suitable for reducing the running times in the case of CPU-bound problems.
Using coroutines
Like threads, coroutines should be only used when the coroutines must wait (typically for an I/O transaction). Otherwhise, use multiprocessing.
Can you write Python program for it?

Give me a the Python program you requested?
assistant
#Here is the Python program you requested.

import asyncio

counter = 10

async def task_1():
    global counter
    for i in range(10):
        print("o", end='', flush=True)
        counter += 1
        await task_2()
            
async def task_2():
    global counter
    print("O", end='', flush=True)
    counter -= 1

await task_1()

print('\ncounter =', counter)

import asyncio
import time

counter = 10

async def task_1():
    global counter
    for i in range(10**6):
        counter += 1
        await task_2()
        
async def task_2():
    global counter
    counter -= 1

now = time.perf_counter()
await task_1()
elapsed = time.perf_counter() - now
print(f"\nelapsed {elapsed:0.2f} seconds")
print('counter =', counter)