Skip to content

Use spawn start method in multiprocessing programs #11391

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

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Set spawn start method in doctest
  • Loading branch information
XuehaiPan committed May 2, 2024
commit cccd92a5478fa4f3404aed8585d72f78df6a3d52
2 changes: 2 additions & 0 deletions sorts/odd_even_transposition_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def oe_process(position, value, l_send, r_send, lr_cv, rr_cv, result_pipe):

def odd_even_transposition(arr):
"""
>>> from multiprocessing import set_start_method
>>> set_start_method("spawn")
>>> odd_even_transposition(list(range(10)[::-1])) == sorted(list(range(10)[::-1]))
True
>>> odd_even_transposition(["a", "x", "c"]) == sorted(["x", "a", "c"])
Expand Down