Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 4.2.0 (2026-08-29)
## 5.0.0 (2026-08-29)

### Added

Expand Down Expand Up @@ -49,6 +49,19 @@
storms, loop churn, 60 s mixed workload with resource counters checked.
- Guide: `docs/isolated.md`, with what each of the three modes guarantees.

### Removed

- The legacy worker API (`py_nif:worker_new/0,1`, `worker_call`, `worker_eval`,
`worker_exec`, `worker_next`, `worker_destroy`, `import_module/2`,
`get_attr/3`, `set_callback_handler/2`, `send_callback_response/2`,
`resume_callback/2`) and the single executor thread behind it, the
`async_worker_*`/`async_call`/`async_gather`/`async_stream` NIFs that only
returned `deprecated`, the unused worker pool (`pool_*` NIFs), the
`cancel_reader/writer` aliases, and the unreachable inline executor
branches of the context NIFs. Contexts (`py_context`, `py:call/3`) are the
only execution path. `py:memory_stats/0` and `py:gc/0,1` now run on the
calling scheduler under the GIL.

### Fixed

- `pthread_timedjoin_np` was called without `_GNU_SOURCE`, an implicit
Expand Down
10 changes: 1 addition & 9 deletions c_src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ where things are.
| `py_nif.h` | All shared types: `py_context_t` and its request queue, request types, callback and suspension state, runtime state machine, atoms, globals, declarations | 2.4k lines. The struct comments carry the locking rules; read `py_context_t` before touching threads |
| `py_nif.c` | Runtime init and finalize, resource types, context create/destroy, the request queue, `worker_context_thread_main` and `owngil_context_thread_main`, `owngil_execute_*` (used by both thread kinds), the `nif_context_*` NIFs, process-local envs, `py_ref`, the NIF function table at the end | Sections are banner-separated; `grep -n '^ \* ===\|^/\* ==='` lists them |
| `py_convert.c` | `py_to_term`, `term_to_py`, depth limits, tagged tuples (`{bytes, B}`, `{'$py_shm', ...}`), error tuples `{error, {Type, Msg}}` | The type mapping tables in the comments are the reference for `_etf.py` |
| `py_exec.c` | Executing a call/eval/exec with suspension support; the legacy single executor thread | |
| `py_exec.c` | Execution mode detection (free-threaded or GIL build) | |
| `py_callback.c` | The `erlang` Python module: `call`, `send`, `whereis`, `schedule*`, `Atom`/`Pid`/`Ref` types, callback delivery paths (suspension, blocking pipe, async pipe), channel and shared-dict methods, callback name registry | `erlang_call_impl` documents the path precedence |
| `py_thread_worker.c` | Python threads calling Erlang through `py_thread_handler` | |
| `py_subinterp_thread.c/.h` | Thread pool of sub-interpreters (owngil contexts, loop pools) | |
| `py_event_loop.c/.h` | `ErlangEventLoop` support: `enif_select` readers and writers, timers, task injection into loops, reactor dispatch, fd registry, Python module `py_event_loop`; plus test-only fd/TCP/UDP NIFs (section "Test Helper Functions") | Largest file |
| `py_channel.c/.h`, `py_buffer.c/.h`, `py_reactor_buffer.c/.h`, `py_shared_dict.c` | Resources with a Python-facing object each | |
| `py_logging.c` | Logging and tracing NIFs | |
| `py_mem_limit.c` | obmalloc arena accounting for owngil memory caps | |
| `py_worker_pool.c/.h` | Legacy pool, no caller in `src/` | Candidate for removal |
| `py_util.c/.h` | Macros, small helpers | |

## Where the live paths are
Expand Down Expand Up @@ -62,10 +61,3 @@ where things are.
3. Add the stub and its `-spec` and doc to `src/py_nif.erl`.
4. Cover it in a suite; `rebar3 dialyzer` and `rebar3 xref` must stay clean.

## Legacy code, for orientation

Not on the path of contexts created today: the `worker_*` NIFs and
"Worker management" section, `async_worker_*` NIFs (return `deprecated`),
the "Legacy mode" inline branches in `nif_context_call/eval/exec`,
`py_worker_pool.c`, and the `cancel_reader/writer` aliases. When in doubt,
follow `nif_context_call_async` and ignore the rest.
Loading
Loading