parallel processing - Python producer and consumer system design -
if i'm writing python program execute other 2 executables(c++) in producer , consumer manner, right lib do? asyncio? multiprocessing?
the main execution thread or process is:
- monitoring status of producer , consumer processes.
- if 1 of them fails, terminate other.
- if ctrl-c received, terminate both of them
- if both of them finishes, exit , report success.
the producer:
- keep generating data temp file. (that temp file might fifo os.mkfifo()?)
the consumer:
- keep consuming temp file
both producer , consumer cpu intensive, , need run in parallel. ideally intermediate temp file doesn't need touch real storage , stay in memory. otherwise performance big concern since temp file of size 10gb or so.
Comments
Post a Comment