Browse Source

Threading

pull/46/head
Jure Šorn 4 years ago
parent
commit
661e658cca
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -2014,7 +2014,7 @@ from collections import deque
Threading Threading
--------- ---------
* **CPython interpreter can only run a single thread at a time.** * **CPython interpreter can only run a single thread at a time.**
* **That is why using multiple threads won't result in a faster execution, unless there is an I/O operation in at least one of them.**
* **That is why using multiple threads won't result in a faster execution, unless one or more threads contain an I/O operation.**
```python ```python
from threading import Thread, RLock from threading import Thread, RLock
``` ```

2
index.html

@ -1778,7 +1778,7 @@ db = connector.connect(host=<str>, user=<str>, password=<str>,
</code></pre> </code></pre>
<div><h2 id="threading"><a href="#threading" name="threading">#</a>Threading</h2><ul> <div><h2 id="threading"><a href="#threading" name="threading">#</a>Threading</h2><ul>
<li><strong>CPython interpreter can only run a single thread at a time.</strong></li> <li><strong>CPython interpreter can only run a single thread at a time.</strong></li>
<li><strong>That is why using multiple threads won't result in a faster execution, unless there is an I/O operation in at least one of them.</strong></li>
<li><strong>That is why using multiple threads won't result in a faster execution, unless one or more threads contain an I/O operation.</strong></li>
</ul><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> threading <span class="hljs-keyword">import</span> Thread, RLock </ul><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> threading <span class="hljs-keyword">import</span> Thread, RLock
</code></pre></div> </code></pre></div>

Loading…
Cancel
Save