@H2HOLE · Post #161 · 27.05.2024 г., 16:25
Python 3.13 起已可使用 --disable-gil 关闭 GIL。 https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython thread: /4469 #Python#GIL
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #422 · 30 мар.
Если запустить REPL с модулем asyncio, то вы входите в особый асинхронный REPL. user@host:~$ python -m asyncio asyncio REPL 3.12.7 ... Use "await" directly instead of "asyncio.run()". >>> import asyncio >>> В этом режиме - создаётся и настраивается event loop - уже импортирован asyncio - работает await на верхнем уровне То есть такая команда сработает без ошибок! await asyncio.sleep(3) Удобно для тестирования асинхронных функций без создания ивентлупов и остальной обвязки. Работает в: 3.8+ #tricks#async
Пребарај: #gil
@H2HOLE · Post #161 · 27.05.2024 г., 16:25
Python 3.13 起已可使用 --disable-gil 关闭 GIL。 https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython thread: /4469 #Python#GIL
@djangoproject · Post #156 · 06.09.2016 г., 01:43
https://wiki.python.org/moin/GlobalInterpreterLock In #CPython, the #global#interpreter lock, or #GIL, is a mutex that prevents multiple native #threads from executing Python bytecodes at once. This lock is necessary mainly because CPython's memory management is not thread-safe. (However, since the GIL exists, other features have grown to depend on the guarantees that it enforces.)