Is it safe to modify unique dictionary entries from concurrent threads in Python?

Viewed 19

If I was to do something like:

def do_operation(operation, results):
    results[operation.unique_name] = operation.get_result()

results = {}
for operation in operations:
    thread.Thread(target=do_operation, args=(operation, results)).run()

Would that be a safe operation for the dictionary?

0 Answers
Related