kivy / kivy/python-for-android

Allow multiple python interpreters per process

Offen
#2,609 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature-request
Vorherrschende Sprache
Python
Sterne
8.9k
Forks
2k
Ø Merge
12 Std. 20 Min.
Gemergte PRs (30 T.)
9

Beschreibung

Checklist
  • the issue is indeed a bug and not a support request
  • issue doesn't already exist: https://github.com/kivy/python-for-android/issues
  • I have a short, runnable example that reproduces the issue
  • I reproduced the problem with the latest development version (p4a.branch = develop)
  • I used the grave accent (aka backticks) to format code or logs when appropriated
Versions
  • Python: 3.9
  • OS: Linux
  • Kivy: N/A
  • Cython: N/A
  • OpenJDK: 11
Description

Currently the native code starting the python interpreter only handles a single interpreter per process. This limits how applications handle services (and soon workers) as the python interpreter always has to be run in a separate process instead of a separate thread in the current process. This is managed in the AndroidManifest.xml file by declaring android:process in the service declarations.

Python does support this via sub-interpreters, but the setup is more complex. It would be nice to support that, though. Particularly for workers where they currently have to use more complex RemoteListenableWorker class.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit pythonforandroid/bootstraps/common/build/jni/application/src/start.c und prüfe, wie das AndroidManifest.xml Dienstprozesse deklariert. Lies die Dokumentation von Python zur Unterstützung von Sub-Interpretern und überlege, wie dies mit Workern und RemoteListenableWorker zusammenhängt. Als erledigt gilt, dass Dienste oder Worker mehrere Python-Interpreter innerhalb eines Prozesses verwenden können, statt separate Prozesse zu erfordern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, python
Bereich
mobile-dev
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.