@@ -11,6 +11,20 @@ Pythonx runs a Python interpreter in the same OS process as your Elixir
1111application, allowing you to evaluate Python code and conveniently
1212convert between Python and Elixir data structures.
1313
14+ The goal of this project is to better integrate Python workflows within
15+ Livebook and its usage in actual projects must be done with care due to
16+ Python's global interpreter lock (GIL), which prevents from multiple threads
17+ executing Python code at the same time. Consequently, calling ` Pythonx `
18+ from multiple Elixir processes does not provide the concurrency you might
19+ expect and thus it can be a source of bottlenecks. However, this concerns
20+ regular Python code. Packages with CPU-intense functionality, such as ` numpy ` ,
21+ have native implementation of many functions and invoking those releases the
22+ GIL. GIL is also released when waiting on I/O operations. In other words,
23+ if you are using this library to integrate with Python, make sure it happens
24+ in a single Elixir process or that its underlying libraries can deal with
25+ concurrent invocation. Otherwqise, prefer to use Elixir's ` System.cmd/3 ` or
26+ ` Port ` s to manage multiple Python programs via I/O.
27+
1428## Usage (script)
1529
1630Add Pythonx to your dependencies:
@@ -104,7 +118,7 @@ Configure the desired Python version and dependencies in your
104118``` elixir
105119import Config
106120
107- config :pythonx , :uv ,
121+ config :pythonx , :uv_init ,
108122 pyproject_toml: """
109123 [project]
110124 name = "project"
0 commit comments