## 6.2 asyncio 

Due to significant security concerns, the reuse_address parameter of asyncio.loop. create_datagram_endpoint() is no longer supported. This is because of the behavior of the socket option SO_REUSEADDR in UDP. For more details, see the documentation for loop. create_datagram_endpoint() . (Contributed by Kyle Stanley, Antoine Pitrou, and Yury Selivanov in bpo-37228.) 

Added a new coroutine shutdown_default_executor() that schedules a shutdown for the default executor that waits on the ThreadPoolExecutor to finish closing. Also, asyncio.run() has been updated to use the new coroutine. (Contributed by Kyle Stanley in bpo-34037.) 

Added asyncio.PidfdChildWatcher , a Linux-specific child watcher implementation that polls process file descriptors. (bpo-38692) 

Added a new coroutine$_{asyncio.to_thread()}$ . It is mainly used for running IO-bound functions in a separate thread to avoid blocking the event loop, and essentially works as a high-level version of$_{run_in_executor()}$ that can directly take keyword arguments. (Contributed by Kyle Stanley and Yury Selivanov in bpo-32309.) 

When cancelling the task due to a timeout,$_{asyncio.wait_for()}$ will now wait until the cancellation is complete also in the case when timeout is <= 0, like it does with positive timeouts. (Contributed by Elvis Pranskevichus in bpo- 32751.) 

$_{asyncio}$now raises$_{TyperError}$ when calling incompatible methods with an$_{ssl.SSLSocket}$socket. (Con- tributed by Ido Michael in bpo-37404.) 

## 6.3 compileall 

Added new possibility to use hardlinks for duplicated$_{.pyc}$ files: hardlink_dupes parameter and –hardlink-dupes command line option. (Contributed by Lumír ‘Frenzy’ Balhar in bpo-40495.) 

Added new options for path manipulation in resulting$_{.pyc}$ files: stripdir , prependdir , limit_sl_dest parameters and -s, -p, -e command line options. Added the possibility to specify the option for an optimization level multiple times. (Contributed by Lumír ‘Frenzy’ Balhar in bpo-38112.) 

## 6.4 concurrent.futures 

Added a new cancel_futures parameter to$_{concurrent.futures.Executor.shutdown()}$ that cancels all pending futures which have not started running, instead of waiting for them to complete before shutting down the executor. (Contributed by Kyle Stanley in bpo-39349.) 

Removed daemon threads from$_{ThreadPoolExecutor}$and$_{ProcessPoolExecutor}$ . This improves com- patibility with subinterpreters and predictability in their shutdown processes. (Contributed by Kyle Stanley in bpo- 39812.) 

Workers in$_{ProcessPoolExecutor}$are now spawned on demand, only when there are no available idle workers to reuse. This optimizes startup overhead and reduces the amount of lost CPU time to idle workers. (Contributed by Kyle Stanley in bpo-39207.) 

