Dear all,<br><br>I am trying to use multiprocessing module.<br>I have 5 functions and 2000 input files.<br><br>First, I want to make sure that these 5 functions execute one after the other.<br>Is there any way that I could queue these 5 functions within the same script ?<br>
<br><br>Next, as there are 2000 input files.<br>I could queue them by queue.put() and get back to run one by one using queue.get() as follows:<br><br>for file in files:<br> if '.dat.gz' in file:<br> q.put(file)<br>
<br>while True:<br> item = q.get()<br> x1 = f1(item)<br> x2 = f2(x1)<br> x3 = f3(x2)<br> x4 = f4(x3)<br> final_output = f5(x4)<br><br><br>However, how can I input them on my 8 core machine, so that at a time 8 files will be processed (to the set of 5 functions; each function one after the other) ?<br>
<br>I am bit confused with the multiprocessing, please suggest me some directions ....<br><br>Thank you<br><br><br>-- Joshi<br><br clear="all"><br><br>