mkdir ~/mongodb # use --fork to run mongodb server as daemon mongod --dbpath ~/mongodb/ --fork --logpath ~/mongo/mongodb.log
Friday, 17 July 2015
Starting mongodb without root permission
Thursday, 19 March 2015
Summary of concurrency and parallelism in Python
1. For IO bound code, both threading and multiprocessing will work. Multiprocessing is easier to setup using multiprocessing.Pool than threading (with Queue and threading.Thread) , but it has to keep multiple copies of data in memory, resulting in a higher memory overhead.
2. For CPU bound code, multiprocessing is more likely to be better because it has true parallelism. Threading doesn’t in Python due to GIL.
3. For CPU bound code that needs to copy around big chunks of data, which may not fit into the memory, then explicitly share the data using multiprocessing.Value and multiprocessing.Array.
Reference:
Subscribe to:
Posts (Atom)