Multiple DMA - questions about wait()?

Hello ,
I want to ask these questions!

1)If we have enable interrupts from ps to pl does it change the fact that we put
dma.sendchannel.wait()?
As i have understand wait method is something like polling techinique but when we enable interrupts there is no reason to have wait.I am not sure although.

2)If we must put wait() and we have multiple dma transactions do we write
dma_one.sendchannel.wait()
dma_two.sendchannel.wait()
.
.
dma_one.recvchannel.wait()
etc?
Cause wait() method consume a lot of software time?

With interrupts enabled you can use Python’s asyncio framework and the wait_async coroutine in place of wait. We don’t have a DMA example for this but you can see the ideas in the asyncio_buttons.ipynb notebook.

Peter

Thank you very much for your answer.
I am trying to understand but because it is my first time trying to do something with interrupts and also use asyncio could you write only for python like a pseudocode on how i could use interrupt? Lets say i have one DMA instatiation and i have this:
def callpl(buf):
input_buffer = allocate(shape=(len(buf),), dtype=‘S64’)
input_buffer[:] = np.array(buf)
dma_one.sendchannel.transfer(input_buffer)
dma_one.recvchannel.transfer(ouput_buffer)
# dma_one.sendchannel.wait() — I do not want to use this wait but interrupt logic as you said
return output_buffer.copy()

In Python 3.6 the magic incantation is something like

asyncio.get_event_loop().run_until_complete(
    asyncio.ensure_future(dma_one.sendchannel.wait_async()))

If you’re running in Jupyter you might also need to the nest-asyncio package installed and applied.

Peter