-
-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Description
Hi,
I'm not sure whether this is a known issue, but if I run pyosmium parsing in a thread then the process hangs indefinitely. For example:
import sys
import threading
import osmium
function_complete = threading.Event()
def run_parsing(filename):
print("Parsing %s ..." % filename)
h = osmium.SimpleHandler()
h.apply_file(filename)
print("Parsed %s" % filename)
function_complete.set()
if __name__ == "__main__":
test_file = sys.argv[1]
run_parsing(test_file)
function_complete.clear()
threading.Thread(target=run_parsing, args=(test_file,))
function_complete.wait(timeout=10)
if not function_complete.is_set():
raise RuntimeError("parsing did not complete")
will parse when in the main thread, then raise as the threaded parsing never completes. Is this behaviour understood?
I'm running this on macOS in python 2.7.
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels