Best practices for multi-threading in Python
Posted on 2015-02-13
I'm fairly new to Python; and I'm trying to find some resources that properly explains how to structure a multi-threaded Python project. This will be running in GNU/Linux.
My main concern is that I have a dictionary that needs to be read by all the threads; would it be possible to access the dictionary in each thread without explicitly passing the variable into each thread?
Also, I would need to write into multiple files; would it be better to have one thread that accesses these files, or is Python/Unix smart enough to allow one thread to finish writing the entire line before another thread jumps in to write something?
Appreciate any advice on this!