PyDocs

Nav

Concurrent Execution

Thread.start

threading

method of Thread (source) not WASI
  • Thread.start()
Start the thread's activity.

It must be called at most once per thread object. It arranges for the
object's run() method to be invoked in a separate thread of control.

This method will raise a RuntimeError if called more than once on the
same thread object.
Changed in 3.14
  • 3.14: Set the operating system thread name.
1 Example
>>> log = []
>>> def f():
...     items = sorted(mydata.__dict__.items())
...     log.append(items)
...     mydata.number = 11
...     log.append(mydata.number)

>>> import threading
>>> thread = threading.Thread(target=f)
>>> thread.start()
>>> thread.join()
>>> log
[[], 11]
from the Python docs
See Also
No see-alsos for threading/Thread.start
0 Notes
No notes for Thread.start