# HG changeset patch # User paulb # Date 1127924646 0 # Node ID a915bbb6cb54396e12019da1fdebcec3a49a7c1e # Parent f485152f020c081ce119ff8039428c0e24469047 [project @ 2005-09-28 16:24:06 by paulb] Introduced usage of the waitall function which waits for all created/child processes. diff -r f485152f020c -r a915bbb6cb54 tests/start_indexer.py --- a/tests/start_indexer.py Wed Sep 28 16:23:54 2005 +0000 +++ b/tests/start_indexer.py Wed Sep 28 16:24:06 2005 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python -from parallel import start, Exchange +from parallel import start, Exchange, waitall from Dict import Indexer, Searcher, Parser def apply_parser(channel, filename): @@ -33,6 +33,8 @@ for channel in channels: channel.close() + waitall() + # Provide a search interface. return Searcher(master_index.get_index()) @@ -52,14 +54,7 @@ # Get a searcher using an index built in parallel. searcher = get_searcher(filenames, window_size) - - # Wait for all created processes to terminate. - - try: - while 1: - os.wait() - except OSError: - pass + waitall() # Present a user interface.