This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Warning: executor.shutdown(wait=False) causes deadlocks for instances of | |
concurrent.futures.ProcessPoolExecutor. | |
Not intended for usage outside of debugging and demonstration purposes. | |
Tested on Python 3.7.6 and 3.8.1. | |
""" | |
import concurrent.futures as cf | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Requires | |
https://github.com/aeros/cpython/tree/bpo39349-add-cancel_futures-to-Executor.shutdown. | |
See https://github.com/python/cpython/pull/18057 for details. | |
""" | |
import concurrent.futures as cf | |
import time | |
def wait_return(duration, result): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import types | |
import gc | |
ignored_types = ( | |
type, | |
types.FunctionType, | |
types.LambdaType, | |
types.MethodType, | |
types.BuiltinFunctionType, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Authored by: Kyle Stanley (https://github.com/aeros) | |
import asyncio | |
import concurrent.futures | |
import threading | |
import functools | |
import weakref | |
import os | |
# Only needed for demo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import time | |
total_tests = 10_000_000 | |
async def test_get_running_loop(): | |
return asyncio.get_running_loop() | |
async def test_get_event_loop(): | |
return asyncio.get_event_loop() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Created for the purpose of comparing the construction time | |
between ``dict``, ``ChainMap``, and the proposed ``frozenmap`` in PEP-603. | |
""" | |
import sys | |
import time | |
import collections | |
import immutables |