Skip to content

npryce/python-parallelize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-parallelize

Simple fork/join parallelism with Python's for loop

Quick Start

Parallel iteration with a process/CPU:

import os
from parallelize import parallelize
    
for i in parallelize(range(100)):
    print(os.getpid(), i)

Parallel iteration with a process/item:

import os
from parallelize import parallelize, per_item
    
for i in parallelize(range(100), fork=per_item):
    print(os.getpid(), i)

About

Simple fork/join parallelism with Python's for loop

Resources

Stars

Watchers

Forks

Packages

No packages published