Skip to content

Simple multiprocess compute for Python ,get the benifit of multi core

Notifications You must be signed in to change notification settings

JetDrag/SimpleMultiprocessCompute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleMultiprocessCompute

Simple multiprocess compute asynchronously for Python, get the benefit of multi core; Using the standard module only.

How to use

Make sure the simple_mp module is below if name == 'main' on Windows Def your founction as the first class, put your task into a list, then, here is an example

  • Example:
from simple_mp import SimpleMP
	task_lst = [1,2,3]
	
	def a(per_num):
      		return per_num + 1

	if __name__ == '__main__':
		mp = SimpleMP(a,task_lst)
		mp.start_with_return()

The result is in file 'result'.

if in every worker, you have saved result use 'open' or 'print', the use fouction 'start_no_return()'

About

Simple multiprocess compute for Python ,get the benifit of multi core

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages