|
import threading
|
|
|
t = threading.Thread(target=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 = threading.Lock()
|
create a lock
|
|
lock.acquire()
|
current thread acquires the lock
|
|
lock.release()
|
current thead release lock
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.