Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free threading support #2

Open
5 tasks
colesbury opened this issue Feb 19, 2025 · 0 comments
Open
5 tasks

Free threading support #2

colesbury opened this issue Feb 19, 2025 · 0 comments
Assignees

Comments

@colesbury
Copy link
Collaborator

Packaging and testing

  • Run pytest-run-parallel tests in CI
  • Build wheels?
  • Rename and edit metadata for fork?

Thread-safety (todo)

  • Some bits in ct_flags are mutable, like CT_LAZY_FIELD_LIST, CT_IS_OPAQUE, and CT_CUSTOM_FIELD_POS | CT_WITH_PACKED_CHANGE. These may need to be moved to ct_flags_mut and we need synchronization for the handling of CT_LAZY_FIELD_LIST.
  • b_complete_struct_or_union (related to above). This realizes the lazy field list.

Thread-safety (done)

  • get_primitive_type: We initialize all primitive types at module initialization, instead of doing them lazily. This is pretty inexpensive (~100 µs).
  • file_struct: now initialized during module initialization
  • _get_ct_int: now initialized during module initialization
  • init_once_cache: The cache itself is initialized under a critical section and we use APIs that return strong references instead of borrowed references.
  • malloc_closure: use a global mutex
  • ...
@colesbury colesbury self-assigned this Feb 19, 2025
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

No branches or pull requests

1 participant