-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added multithreaded version of update_population() to profiling scrip…
…t. For some unknowable reason, parallelized version is slower. ¯\_(ツ)_/¯
- Loading branch information
1 parent
fdc15b6
commit aa47960
Showing
2 changed files
with
48 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from multiprocessing import Pool | ||
|
||
def func(x): | ||
return(a+x) | ||
a = 2 | ||
with Pool(10) as pool: | ||
b = pool.map(func,range(10)) | ||
|
||
print(b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters