0
我正在寫一個簡單的python代碼爲一個非常任務,我猜想一些最好的思想工作?無論如何。 我有一個非常強大的桌面8核(16個虛擬內核)。 我想寫一個程序,它可以在整個語料庫中找到不同的單詞。 或者考慮像詞頻計數這樣的其他任務。 雖然map-reduce的東西很適合分佈式框架。 有沒有辦法利用你的處理器的所有內核?即代碼的多核執行。python代碼跨核心運行
或者也許這樣。 如果我要做到以下幾點:
def hello_word():
print "hello world!"
和替代蟒蛇hello_world.py 我想運行使用我的處理器的所有核心這hello_world.py。 我會做什麼改變? 謝謝
我會檢查出python [multiprocessing](http://docs.python.org/library/multiprocessing.html)模塊。 – 2012-03-15 21:41:07
http://stackoverflow.com/questions/1182315/python-multicore-processing 首次打擊google>「python multicore」 – Marc 2012-03-15 21:56:35