Skip to content

Switch to using threads in snowflake - #965

Merged
bennybp merged 3 commits into
mainfrom
snowflake_threads
Jul 23, 2025
Merged

bennybp merged 3 commits into
mainfrom
snowflake_threads

Conversation

@bennybp

@bennybp bennybp commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Description

Multiprocessing is just awkward. fork can have random issues due to mixing forking and threads (see https://discuss.python.org/t/switching-default-multiprocessing-context-to-spawn-on-posix-as-well/21868)

On the other hand, spawn (and forkserver) are slow and have other awkward requirements (you absolutely need to have any use of a snowflake under an if __name__ == "__main__" block).

So instead lets try threads. This seems to work just fine, although perhaps with some resource usage issues if being highly utilized (GIL and all that).

Status

  • Code base linted
  • Ready to go

@bennybp
bennybp merged commit 254d314 into main Jul 23, 2025
@bennybp
bennybp deleted the snowflake_threads branch July 23, 2025 14:48
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