1.1 --- a/examples/simple_create_queue.py Sat Sep 15 19:41:49 2007 +0000
1.2 +++ b/examples/simple_create_queue.py Sat Sep 15 19:42:24 2007 +0000
1.3 @@ -21,15 +21,16 @@
1.4
1.5 if __name__ == "__main__":
1.6
1.7 + t = time.time()
1.8 +
1.9 # Initialise the communications queue with a limit on the number of
1.10 # channels/processes.
1.11
1.12 queue = pprocess.Queue(limit=limit)
1.13 - t = time.time()
1.14
1.15 # Initialise an array.
1.16
1.17 - D = [0] * N * N
1.18 + results = [0] * N * N
1.19
1.20 # Perform the work.
1.21 # NOTE: Could use the with statement in the loop to package the
1.22 @@ -53,14 +54,15 @@
1.23
1.24 print "Finishing..."
1.25 for i, j, result in queue:
1.26 - D[i*N+j] = result
1.27 + results[i*N+j] = result
1.28
1.29 # Show the results.
1.30
1.31 - print "Time taken:", time.time() - t
1.32 for i in range(0, N):
1.33 - for result in D[i*N:i*N+N]:
1.34 + for result in results[i*N:i*N+N]:
1.35 print result,
1.36 print
1.37
1.38 + print "Time taken:", time.time() - t
1.39 +
1.40 # vim: tabstop=4 expandtab shiftwidth=4