Results of 1 - 10 of about 20 for PyMutex (0.007 sec.)
- 同期プリミティブ — Python 3.14.8 ドキュメント 13442
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 同期プリミティブ テーマ 自動 ライト ダーク | 同期プリミティブ ¶ The C-API provides a basic mutual exclusion lock. type PyMutex ¶
...A mutual exclusion lock. The PyMutex should be initialized to zero to represent the unlocked state. For example: PyMutex mutex = { 0 }; Instances of PyMutex sh...ould not be copied or moved. Both the contents and address of a PyMutex are meaningful, and it must remain at a fixed, writable location in memory. 注釈 A PyMutex currently occupies one byte, bu...nsidered unstable. The size may change in future Python releases without a deprecation period. Added in version 3.13. void PyMutex_Lock ( PyMutex * m ) ¶ Thread safety: Atomic . Lock mutex m . If another thread has already locked it, the calling thread... - https://man.mtool.work/python/3.14/c-api/synchronization.html
- 同期プリミティブ — Python 3.14.8 ドキュメント 13442
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 同期プリミティブ テーマ 自動 ライト ダーク | 同期プリミティブ ¶ The C-API provides a basic mutual exclusion lock. type PyMutex ¶
...A mutual exclusion lock. The PyMutex should be initialized to zero to represent the unlocked state. For example: PyMutex mutex = { 0 }; Instances of PyMutex sh...ould not be copied or moved. Both the contents and address of a PyMutex are meaningful, and it must remain at a fixed, writable location in memory. 注釈 A PyMutex currently occupies one byte, bu...nsidered unstable. The size may change in future Python releases without a deprecation period. Added in version 3.13. void PyMutex_Lock ( PyMutex * m ) ¶ Thread safety: Atomic . Lock mutex m . If another thread has already locked it, the calling thread... - https://man.mtool.work/python/3.14/c-api/synchronization.html
- オブジェクトプロトコル (object protocol) — Python 3.14.8 ドキュメント 8819
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 抽象オブジェクトレイヤ (Abstract Objects Layer) » オブジェクトプロトコル (object protocol) テーマ 自動 ライト ダーク | オブジェク
...the following sketch could be adapted to implement a "weakmap" that works like a WeakValueDictionary for a specific type: PyMutex mutex ; PyObject * add_entry ( weakmap_key_type * key , PyObject * value ) { PyUnstable_EnableTryIncRef ( value ); weakmap..._type weakmap = ...; PyMutex_Lock ( & mutex ); weakmap_add_entry ( weakmap , key , value ); PyMutex_Unlock ( & mutex ); Py_RETURN_NONE ; } PyObject * g...et_value ( weakmap_key_type * key ) { weakmap_type weakmap = ...; PyMutex_Lock ( & mutex ); PyObject * result = weakmap_find ( weakmap , key ); if ( PyUnstable_TryIncRef ( result )) { // `result`... - https://man.mtool.work/python/3.14/c-api/object.html
- オブジェクトプロトコル (object protocol) — Python 3.14.8 ドキュメント 8819
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 抽象オブジェクトレイヤ (Abstract Objects Layer) » オブジェクトプロトコル (object protocol) テーマ 自動 ライト ダーク | オブジェク
...the following sketch could be adapted to implement a "weakmap" that works like a WeakValueDictionary for a specific type: PyMutex mutex ; PyObject * add_entry ( weakmap_key_type * key , PyObject * value ) { PyUnstable_EnableTryIncRef ( value ); weakmap..._type weakmap = ...; PyMutex_Lock ( & mutex ); weakmap_add_entry ( weakmap , key , value ); PyMutex_Unlock ( & mutex ); Py_RETURN_NONE ; } PyObject * g...et_value ( weakmap_key_type * key ) { weakmap_type weakmap = ...; PyMutex_Lock ( & mutex ); PyObject * result = weakmap_find ( weakmap , key ); if ( PyUnstable_TryIncRef ( result )) { // `result`... - https://man.mtool.work/python/3.14/c-api/object.html
- 拡張モジュールを分離する — Python 3.14.8 ドキュメント 8309
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » 拡張モジュールを分離する テーマ 自動 ライト ダーク | 拡張モジュールを分離する ¶ 概要 Traditionally, state belonging to Python extension modules wa
...process-wide flag static int loaded = 0 ; // Mutex to provide thread safety (only needed for free-threaded Python) static PyMutex modinit_mutex = { 0 }; static int exec_module ( PyObject * module ) { PyMutex_Lock ( & modinit_mutex ); if ( loaded ) { Py...tex ); PyErr_SetString ( PyExc_ImportError , "cannot load module more than once per process" ); return -1 ; } loaded = 1 ; PyMutex_Unlock ( & modinit_mutex ); // ... rest of initialization } If your module's PyModuleDef.m_clear function is able to prepa... - https://man.mtool.work/python/3.14/howto/isolating-extensions.html
- 拡張モジュールを分離する — Python 3.14.8 ドキュメント 8309
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » 拡張モジュールを分離する テーマ 自動 ライト ダーク | 拡張モジュールを分離する ¶ 概要 Traditionally, state belonging to Python extension modules wa
...process-wide flag static int loaded = 0 ; // Mutex to provide thread safety (only needed for free-threaded Python) static PyMutex modinit_mutex = { 0 }; static int exec_module ( PyObject * module ) { PyMutex_Lock ( & modinit_mutex ); if ( loaded ) { Py...tex ); PyErr_SetString ( PyExc_ImportError , "cannot load module more than once per process" ); return -1 ; } loaded = 1 ; PyMutex_Unlock ( & modinit_mutex ); // ... rest of initialization } If your module's PyModuleDef.m_clear function is able to prepa... - https://man.mtool.work/python/3.14/howto/isolating-extensions.html
- C API Extension Support for Free Threading — Python 3.14.8 ドキュメント 8241
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » C API Extension Support for Free Threading テーマ 自動 ライト ダーク | C API Extension Support for Free Threading ¶ Starting with the 3.13 release
.... Instead, use Py_BEGIN_CRITICAL_SECTION2 to lock two objects simultaneously. Note that the locks described above are only PyMutex based locks. The critical section implementation does not know about or affect other locking mechanisms that might be in u...se, like POSIX mutexes. Also note that while blocking on any PyMutex causes the critical sections to be suspended, only the mutexes that are part of the critical sections are released. If PyM... - https://man.mtool.work/python/3.14/howto/free-threading-extensions.html
- C API Extension Support for Free Threading — Python 3.14.8 ドキュメント 8241
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » C API Extension Support for Free Threading テーマ 自動 ライト ダーク | C API Extension Support for Free Threading ¶ Starting with the 3.13 release
.... Instead, use Py_BEGIN_CRITICAL_SECTION2 to lock two objects simultaneously. Note that the locks described above are only PyMutex based locks. The critical section implementation does not know about or affect other locking mechanisms that might be in u...se, like POSIX mutexes. Also note that while blocking on any PyMutex causes the critical sections to be suspended, only the mutexes that are part of the critical sections are released. If PyM... - https://man.mtool.work/python/3.14/howto/free-threading-extensions.html
- What's New In Python 3.13 — Python 3.14.8 ドキュメント 7868
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » What's New In Python 3.13 テーマ 自動 ライト ダーク | What's New In Python 3.13 ¶ エディタ : Adam Turner と Thomas Wouters この記事では Py
...GIL を無効化した状態での実行をサポート PyTime C API が追加され、システムクロックへのアクセスが提供されるようになりました。 PyMutex は1バイトのみを占有する新しい軽量ミューテックスとなりました。 新しい 関数群 が、C API において PEP 669 の監視イベントを生成...reStopIterationEvent() PyMonitoring_EnterScope() PyMonitoring_ExitScope() (Contributed by Irit Katriel in gh-111997 ). Add PyMutex , a lightweight mutex that occupies a single byte, and the new PyMutex_Lock() and PyMutex_Unlock() functions. PyMutex_Lock... - https://man.mtool.work/python/3.14/whatsnew/3.13.html
- What's New In Python 3.13 — Python 3.14.8 ドキュメント 7868
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » What's New In Python 3.13 テーマ 自動 ライト ダーク | What's New In Python 3.13 ¶ エディタ : Adam Turner と Thomas Wouters この記事では Py
...GIL を無効化した状態での実行をサポート PyTime C API が追加され、システムクロックへのアクセスが提供されるようになりました。 PyMutex は1バイトのみを占有する新しい軽量ミューテックスとなりました。 新しい 関数群 が、C API において PEP 669 の監視イベントを生成...reStopIterationEvent() PyMonitoring_EnterScope() PyMonitoring_ExitScope() (Contributed by Irit Katriel in gh-111997 ). Add PyMutex , a lightweight mutex that occupies a single byte, and the new PyMutex_Lock() and PyMutex_Unlock() functions. PyMutex_Lock... - https://man.mtool.work/python/3.14/whatsnew/3.13.html