Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hao to support multiprocess Queue in Android #2249

Closed
onsunsl opened this issue Jun 30, 2020 · 1 comment
Closed

Hao to support multiprocess Queue in Android #2249

onsunsl opened this issue Jun 30, 2020 · 1 comment

Comments

@onsunsl
Copy link

onsunsl commented Jun 30, 2020

Versions

  • Python: 3.8.1
  • OS: Ubuntu
  • Kivy: 1.11.1
  • Cython: 0.29.20
  • OpenJDK: 1.8

Description

I use Queue synchronize two process in the code, but there is an error when run in Android.
It works fine under Ubuntu and Windows.

# sub process
class ApiLogUploader(Process):

    def __init__(self, q):
        super(ApiLogUploader, self).__init__()
        self.q = q

# main process
from multiprocessing import Queue
api_log_uploader = ApiLogUploader(Queue())   # <----  raise a exception in here
  • Error info:

This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

Is this a Python bug in Android?

Logs

Traceback (most recent call last):
  File "/home/kivy/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/multiprocessing/synchronize.py", line 28, in <module>
ImportError: cannot import name 'sem_unlink' from '_multiprocessing' (/data/user/0/org.kivy.cpos/files/app/_python_bundle/modules/_multiprocessing.cpython-38.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kivy/test/.buildozer/android/app/common/http_interface.py", line 12, in <module>
  File "/home/kivy/test/.buildozer/android/app/dataprocessing/__init__.py", line 4, in <module>
  File "/home/kivy/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/multiprocessing/context.py", line 103, in Queue
  File "/home/kivy/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/multiprocessing/queues.py", line 39, in __init__
  File "<frozen zipimport>", line 259, in load_module
  File "/home/kivy/test/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3/armeabi-v7a__ndk_target_21/python3/Lib/multiprocessing/synchronize.py", line 30, in <module>
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.

This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.
5
@Julian-O
Copy link
Contributor

Multiprocessing isn't supported by the Android OS. Look at Services instead.

@Julian-O Julian-O closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants