Appium Parallel Execution with python

I am working on automation multiple devices. I have written my tests in Python, and all nodes and are connected to selenium grid.
I currently am using multiprocessing library, where each process tries to connect to a device and runs test. Problem is, running this on 3 devices, is greatly impacting the performance ( scheduler delay ) and often a device gets connection lost.

I have seen people documenting the parallel execution with Java - TestNG framework. What is the alternative for Python. Multithreading would also be a very bad option due to queueing, as I have to check every few seconds for changes in my mobile device in appium. I have tried unittest and pytest but is useful for only running unit tests. What is the alternative way to get off this issue.

Check pytest-xdist https://pypi.org/project/pytest-xdist.

Hi James,I am trying to launch multiple app instances as well, and run actions on one instance before running different actions on a second instance (ideally i want to have 4 instances up at the same time, but execution of actions are sequential from 1 device to the next). Did you end up creating new driver for each instance and run them using Python multiprocessing? I looked at TestNG and ATD as well, but they are all in Java