<p>我一直在看其他人的例子,但我似乎无法让它正常工作。<br/>
它要么使用一个核心,要么基本上冻结玛雅如果给太多的处理,但我似乎从来没有得到一个以上的核心一次工作。</p>
<p>举个例子,这就是我想要它做的,在一个非常基本的层面上。主要是让每个循环在不同的处理器上以不同的值同时运行(在本例中,这两个值将使用两个处理器)</p>
<pre><code>mylist = [50, 100, 23]
newvalue = [50,51]
for j in range(0, len(newvalue)):
exists = False
for i in range(0, len(mylist)):
#search list
if newvalue[j] == mylist[i]:
exists = True
#add to list
if exists == True:
mylist.<a href="https://www.cnpython.com/list/append" class="inner-link">append</a>(mylist)
</code></pre>
<p>有可能把这个拉下来吗?我想使用它的实际代码对于每个循环可能需要几秒钟到大约10分钟的时间,但是理论上它们都可以同时运行,所以我认为多线程可以加快加载速度</p>
<p>请记住,我对python还是比较陌生的,所以一个示例会非常受欢迎</p>
<p>干杯:)</p>