File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- {"translation" : " 93.31 %" , "updated_at" : " 2024-01-23T14 :56:06Z " }
1+ {"translation" : " 93.32 %" , "updated_at" : " 2024-01-24T02 :56:00Z " }
Original file line number Diff line number Diff line change @@ -1206,6 +1206,9 @@ msgid ""
12061206"released around potentially blocking I/O operations like reading or writing "
12071207"a file, so that other Python threads can run in the meantime."
12081208msgstr ""
1209+ "因此,规则要求只有获得 :term:`GIL` 的线程才能在 Python对象上执行操作或调用 Python/C API 函数。 "
1210+ "为了模拟并发执行,解释器会定期尝试切换线程 (参见 :func:`sys.setswitchinterval`)。 锁也会在读写文件等可能造成阻塞的 "
1211+ "I/O 操作时释放,以便其他 Python 线程可以同时运行。"
12091212
12101213#: ../../c-api/init.rst:865
12111214msgid ""
@@ -1214,6 +1217,8 @@ msgid ""
12141217"global variable pointing to the current :c:type:`PyThreadState`: it can be "
12151218"retrieved using :c:func:`PyThreadState_Get`."
12161219msgstr ""
1220+ "Python 解释器会在一个名为 :c:type:`PyThreadState` 的数据结构体中保存一些线程专属的记录信息。 还有一个全局变量指向当前的"
1221+ " :c:type:`PyThreadState`: 它可以使用 :c:func:`PyThreadState_Get` 来获取。"
12171222
12181223#: ../../c-api/init.rst:871
12191224msgid "Releasing the GIL from extension code"
You can’t perform that action at this time.
0 commit comments