mirror of
https://github.com/autistic-symposium/web3-starter-py.git
synced 2025-05-17 22:20:22 -04:00
add concurrence examples
This commit is contained in:
parent
614452d462
commit
516c922e02
15 changed files with 64 additions and 248 deletions
|
@ -7,10 +7,10 @@ import multiprocessing
|
|||
|
||||
def daemon():
|
||||
p = multiprocessing.current_process()
|
||||
|
||||
print('Starting: {}, {}'.format(p.name, p.pid))
|
||||
|
||||
sys.stdout.flush()
|
||||
time.sleep(2)
|
||||
time.sleep(1)
|
||||
print('Exiting : {}, {}'.format(p.name, p.pid))
|
||||
|
||||
sys.stdout.flush()
|
||||
|
@ -18,8 +18,8 @@ def daemon():
|
|||
|
||||
def non_daemon():
|
||||
p = multiprocessing.current_process()
|
||||
|
||||
print('Starting: {}, {}'.format(p.name, p.pid))
|
||||
|
||||
sys.stdout.flush()
|
||||
print('Exiting : {}, {}'.format(p.name, p.pid))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue