简体   繁体   中英

What is the concurrent.futures-equivalent of multiprocessing.Lock?

For consistency, I'm trying to port some older code based on multiprocessing to concurrent.futures (using ProcessPoolExecutor ). In my old code, I'm using the Lock class to synchronize writing to stdout. I can't seem to find a similar class in concurrent.futures . Is there one?

concurrent.futures is implemented on top of multiprocessing that is why it does not provide such an interface itself. You can test this by passing a lock to as a job argument.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM