双线程?

时间:2016-09-17 00:01:33

标签: python multithreading

我正在尝试做双线程。类似的东西:

gem 'mysql2', '~> 0.3.20'

这意味着:我正在尝试与每个for wordToScan in wordsList: #...some code for i in range(10): i_thread = Thread(target=words_Scan_Start, args=(dictionaryFile, wordToScan)) i_thread.start() def words_Scan_Start(dictionaryFile, wordToScan): # Here I need to make an action with "wordToScan". # But in 10 threads "range(10)" and use the same "dictionaryFile" for every thread. #............... 同时在10个线程中执行某些操作。但是对于同一个wordToScan

dictionaryFile中为每个下一个项目执行某些操作,直到文件/列表结束。但同时对于使用相同range(10):的每个wordToScan in wordsList:

0 个答案:

没有答案