It sounds like you have already figured most of this out the hard way, here is a small multiprocessing app I wrote. You approach is correct and that crazy indenting is required. https://github.com/ElliotGarbus/MidiClockGenerator
Can you say more about what computation is going on in each of the processes? Is this a candidate for threading – that would remove the data sharing challenges. Perhaps there are some other algorithm choices?
Python 3.8 introduces a package for shared memory multiprocessing… I have not used it, and then you would have the complexity of building your own kivy distribution.
Global variables will not solve your problem. Each process has it’s own address space.
You could use the filesystem to pass data.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d305c2fe-7261-4c0b-8238-75550b257653n%40googlegroups.com.
I don’t think Jumping over to Linux will not solve your problem. You still need to isolate your kivy process from your compute processes. This requires the uncomfortable indenting.
Have you explored queues or pipes to share data?
From: David Murphy
Sent: Saturday, July 4, 2020 5:24 AM
To: Kivy users support
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/0f586ddb-9d04-4a9b-a7d6-73a330ce4e08o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
Robert,
Just out of curiosity, can you explain how Python threads work on Android? What is the underlying mechanism? How do they get around the GIL?
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/9b3f5537-8cbf-4ff9-a4b5-577e77cea160o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/9b3f5537-8cbf-4ff9-a4b5-577e77cea160o%40googlegroups.com.
Thanks for the response.
It is a little mind bending to think that an environment that does not have true multi-threading support, gets real multi-threading by changing an underlying runtime component …and the code still runs correctly. That is really impressive.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/8ee239e9-4c95-40ee-bcdf-1719590df8fco%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/9b3f5537-8cbf-4ff9-a4b5-577e77cea160o%40googlegroups.com.
It is a little mind bending...
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/8ee239e9-4c95-40ee-bcdf-1719590df8fco%40googlegroups.com.