You have a few issues. First of all, you are not parallelizing. You doing:
result = pool.apply_async(gainOneFile,(abs_from_filename,))
arr.append(result.get())
, , .get(), , - ; . .get(), .get() . Pool.map - , . ( imap_unordered, , ):
# Make generator of paths to load
paths = (os.path.join(path, "outputDict"+str(i)) for i in xrange(1, 40))
# Load them all in parallel, and sort the results by length (lambda is redundant)
arr = sorted(pool.imap_unordered(gainOneFile, paths), key=len)
-, multiprocessing , , , . , , , , .
, , ; import import multiprocessing.dummy as mp, Pool, ; CPython GIL, I/O, , , IPC, .
, Python 3.3 UNIX- , , , . , os.posix_fadvise (.fileno() ) WILLNEED SEQUENTIAL , - , , .