mirror of
https://github.com/autistic-symposium/web3-starter-py.git
synced 2025-05-18 06:30:23 -04:00
add some multiprocess and race condition examples
This commit is contained in:
parent
5224dc91ca
commit
be98abd3b5
4 changed files with 57 additions and 4 deletions
15
Concurrence_examples/logging_example.py
Normal file
15
Concurrence_examples/logging_example.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import multiprocessing
|
||||
import logging
|
||||
import sys
|
||||
|
||||
def worker():
|
||||
print 'Doing some work'
|
||||
sys.stdout.flush()
|
||||
|
||||
if __name__ == '__main__':
|
||||
multiprocessing.log_to_stderr(logging.DEBUG)
|
||||
p = multiprocessing.Process(target=worker)
|
||||
p.start()
|
||||
p.join()
|
Loading…
Add table
Add a link
Reference in a new issue