Skip to content

docs: clarify threading model guidance#1049

Merged
stephenamar-db merged 1 commit into
databricks:masterfrom
He-Pin:docs/threading-model-guidance
Jun 25, 2026
Merged

docs: clarify threading model guidance#1049
stephenamar-db merged 1 commit into
databricks:masterfrom
He-Pin:docs/threading-model-guidance

Conversation

@He-Pin

@He-Pin He-Pin commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a Threading Model section to CLAUDE.md
  • Clarify that a single Interpreter does not need internal multithreaded evaluation
  • Require independent Interpreter instances to be safe for concurrent application use on platforms that support concurrency
  • Treat shared mutable state as exceptional and require an explicit concurrency contract plus tests

Verification

  • git diff --check -- CLAUDE.md

@He-Pin He-Pin force-pushed the docs/threading-model-guidance branch 2 times, most recently from ea20873 to 3a91b30 Compare June 25, 2026 16:48
Comment thread CLAUDE.md
- **No internal multithreading requirement**: A single `Interpreter` does not need to evaluate a program using multiple threads.
- **Independent interpreters should be concurrency-friendly**: Applications should be able to run multiple independent `Interpreter` instances concurrently in the same JVM.
- **Shared mutable state is exceptional**: State should belong to an interpreter or evaluation unless it has an explicit concurrency contract and tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Motivation:
Prevent future AI-assisted changes from introducing unsafe assumptions about interpreter threading or shared state.

Modification:
Add a Threading Model section to CLAUDE.md covering allowed parallel evaluation, interpreter isolation, and explicit contracts for shared mutable state.

Result:
Repository guidance now supports future parallel evaluation while preserving deterministic behavior and cross-platform interpreter isolation.
@He-Pin He-Pin force-pushed the docs/threading-model-guidance branch from 3a91b30 to ba03948 Compare June 25, 2026 16:58
@stephenamar-db stephenamar-db merged commit 768836e into databricks:master Jun 25, 2026
5 checks passed
@He-Pin He-Pin deleted the docs/threading-model-guidance branch June 25, 2026 17:53
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.

2 participants