python thread Cheat Sheet

A Programming › Python cheat sheet in English by xys

python thread cheat sheet

1,429 views 516 downloads 20 Dec 2020 History

threading summary

import threading
t = thread­ing.Th­rea­d(t­arget=fun, args = iter,name=thread name)
creat a thread
t.start()
start thread t
t.join()
join thread t, other threads waiting until t finishes
lock = thread­ing.Lock()
create a lock
lock.a­cqu­ire()
current thread acquires the lock
lock.r­ele­ase()
current thead release lock

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.