I have a for loop where I am passing list of schema names to the loop. I want to execute these in parallel because there is no relation between these schemas.
I am using Python 2.6.
Creating dictionary here with schema information.
region_by_schema = {}
region_by_schema['UTEST_TT'] = 'tt'
region_by_schema['UTEST_V3'] = 'v3'
region_by_schema['UTEST_WRITE_SERVER'] = ''
region_by_schema['UTEST_PROPERTY'] = ''
region_by_schema['UTEST_PROJECT'] = ''
Looping through schema here:
for base_schema in region_by_schema.keys():
do_one_user(base_schema, opt_password)
In do_one_user
I am creating a directory with base_schema
name and I am doing some work there.
So I want to execute these 5 schemas in parallel so that my work will finish fast. I want to put the code below in threads or multiprocessing:
for base_schema in region_by_schema.keys():
do_one_user(base_schema, opt_password)
Please let me know the approach.