This is my simple code where I want to run printRange() in parallel:
def printRange(lrange):
print ("First is " + str(lrange[0]) + " and last is " + str(lrange[1]))
def runInParallel():
ranges = [[0, 10], [10, 20], [20, 30]]
// Call printRange in parallel with each sublist of ranges given as argument
My question is different from this SO question as here, the each process is hardcoded, started and finally joined. I want to run printRange() in parallel with say 100 other printRange() worker functions. Hardcoding each time is not feasible. How could this be done?