Skip to content

Simplify execution model to worker + owngil modes (v3.0.0)#61

Open
benoitc wants to merge 1 commit intomainfrom
feature/simplify-execution-model
Open

Simplify execution model to worker + owngil modes (v3.0.0)#61
benoitc wants to merge 1 commit intomainfrom
feature/simplify-execution-model

Conversation

@benoitc
Copy link
Copy Markdown
Owner

@benoitc benoitc commented Apr 8, 2026

Summary

  • Simplify public execution model to two modes: worker and owngil
  • Each context gets dedicated pthread with stable thread affinity
  • Remove multi-executor pool and py:num_executors/0
  • Async NIF dispatch with message passing

Breaking Changes

  • py:execution_mode/0 returns worker | owngil only
  • Removed py:num_executors/0
  • context_mode config accepts worker | owngil

Fixes numpy/torch/tensorflow thread-local state issues.

Breaking changes for v3.0.0:
- py:execution_mode/0 now returns worker | owngil only
- Removed py:num_executors/0 (each context has own worker thread)
- Removed multi_executor pool and dead dispatch code

Architecture changes:
- Per-context worker threads with stable thread affinity
- Async NIF dispatch with message passing (no dirty scheduler blocking)
- Request queue per context (replaces single-slot pattern)

Fixes numpy/torch/tensorflow thread-local state issues.
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

Successfully merging this pull request may close these issues.

1 participant