<p>假设我有以下Python代码:</p>
<pre><code>from itertools import count, tee
original = count() # just an example, can be another iterable
a, b = tee(original)
</code></pre>
<p>问题是,如果我开始在一个线程中迭代“a”,同时在另一个线程中迭代“b”,会有什么问题吗?显然,a和b共享一些数据(原始的iterable,+一些额外的东西,内部缓冲区或其他东西)。那么,a.next()和b.next()在访问共享数据时是否会执行适当的锁定?在</p>