per page, with , order by , clip by
Results of 1 - 10 of about 98 for blocking (0.009 sec.)
C API Extension Support for Free Threading — Python 3.14.8 ドキュメント 10806
ナビゲーション 索引 モジュール | 次へ | 前へ | 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 ... e thread has a valid Python thread state. You should continue to call PyEval_SaveThread() or Py_BEGIN_ALLOW_THREADS around blocking operations, such as I/O or lock acquisitions, to allow other threads to run the cyclic garbage collector . Protecting Inte ... er lock or performing I/O), the critical section is temporarily suspended—all locks are released—and then resumed when the blocking operation completes. This behavior is similar to what happens with the GIL when a thread makes a blocking call. The key di ... hey must be paired and within the same scope) Critical sections automatically release and reacquire locks around potential blocking operations Deadlock Avoidance ¶ Critical sections help avoid deadlocks in two ways: If a thread tries to acquire a lock th ...
https://man.mtool.work/python/3.14/howto/free-threading-extensions.html
C API Extension Support for Free Threading — Python 3.14.8 ドキュメント 10806
ナビゲーション 索引 モジュール | 次へ | 前へ | 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 ... e thread has a valid Python thread state. You should continue to call PyEval_SaveThread() or Py_BEGIN_ALLOW_THREADS around blocking operations, such as I/O or lock acquisitions, to allow other threads to run the cyclic garbage collector . Protecting Inte ... er lock or performing I/O), the critical section is temporarily suspended—all locks are released—and then resumed when the blocking operation completes. This behavior is similar to what happens with the GIL when a thread makes a blocking call. The key di ... hey must be paired and within the same scope) Critical sections automatically release and reacquire locks around potential blocking operations Deadlock Avoidance ¶ Critical sections help avoid deadlocks in two ways: If a thread tries to acquire a lock th ...
https://man.mtool.work/python/3.14/howto/free-threading-extensions.html
threading --- スレッドベースの並列処理 — Python 3.14.8 ドキュメント 9865
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 並行実行 » threading --- スレッドベースの並列処理 テーマ 自動 ライト ダーク | threading --- スレッドベースの並列処理 ¶ ソースコード ... t threading import time def crawl ( link , delay = 3 ): print ( f "crawl started for { link } " ) time . sleep ( delay ) # Blocking I/O (simulating a network request) print ( f "crawl ended for { link } " ) links = [ "https://python.org" , "https://docs. ... た。 参考 concurrent.futures.ThreadPoolExecutor offers a higher level interface to push tasks to a background thread without blocking execution of the calling thread, while still being able to retrieve their results when needed. queue provides a thread-saf ... In earlier Pythons, Lock was a factory function which returned an instance of the underlying private lock type. acquire ( blocking = True , timeout = -1 ) ¶ ブロックあり、またはブロックなしでロックを獲得します。 引数 blocking を True (デフォルト) に設定 ...
https://man.mtool.work/python/3.14/library/threading.html
threading --- スレッドベースの並列処理 — Python 3.14.8 ドキュメント 9865
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 並行実行 » threading --- スレッドベースの並列処理 テーマ 自動 ライト ダーク | threading --- スレッドベースの並列処理 ¶ ソースコード ... t threading import time def crawl ( link , delay = 3 ): print ( f "crawl started for { link } " ) time . sleep ( delay ) # Blocking I/O (simulating a network request) print ( f "crawl ended for { link } " ) links = [ "https://python.org" , "https://docs. ... た。 参考 concurrent.futures.ThreadPoolExecutor offers a higher level interface to push tasks to a background thread without blocking execution of the calling thread, while still being able to retrieve their results when needed. queue provides a thread-saf ... In earlier Pythons, Lock was a factory function which returned an instance of the underlying private lock type. acquire ( blocking = True , timeout = -1 ) ¶ ブロックあり、またはブロックなしでロックを獲得します。 引数 blocking を True (デフォルト) に設定 ...
https://man.mtool.work/python/3.14/library/threading.html
Coroutines and tasks — Python 3.14.8 ドキュメント 9382
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » Coroutines and tasks テーマ 自動 ライト ダーク | Coroutines and tasks ¶ ... IO-bound functions/methods that would otherwise block the event loop if they were run in the main thread. For example: def blocking_io (): print ( f "start blocking_io at { time . strftime ( ' %X ' ) } " ) # Note that time.sleep() can be replaced with an ... y blocking # IO-bound operation, such as file operations. time . sleep ( 1 ) print ( f "blocking_io complete at { time . strftime ( ' ... def main (): print ( f "started main at { time . strftime ( ' %X ' ) } " ) await asyncio . gather ( asyncio . to_thread ( blocking_io ), asyncio . sleep ( 1 )) print ( f "finished main at { time . strftime ( ' %X ' ) } " ) asyncio . run ( main ()) # Exp ...
https://man.mtool.work/python/3.14/library/asyncio-task.html
timer file descriptor HOWTO — Python 3.14.8 ドキュメント 9382
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » timer file descriptor HOWTO テーマ 自動 ライト ダーク | timer file descriptor HOWTO ¶ リリース : 1.13 This HOWTO discusses Python's support for th ... s how to use a timer file descriptor to execute a function twice a second: # Practical scripts should use really use a non-blocking timer, # we use a blocking timer here for simplicity. import os , time # Create the timer file descriptor fd = os . timerf ... host. # sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) sock . bind (( "127.0.0.1" , 1234 )) sock . setblocking ( False ) sock . listen ( 1 ) ep . register ( sock , select . EPOLLIN ) # Create timer file descriptors in non-blocking mo ... heck if there is a connection request. print ( f "Accepting connection { fd } " ) conn , addr = sock . accept () conn . setblocking ( False ) print ( f "Accepted connection { conn } from { addr } " ) ep . register ( conn , select . EPOLLIN ) elif conn an ...
https://man.mtool.work/python/3.14/howto/timerfd.html
Coroutines and tasks — Python 3.14.8 ドキュメント 9382
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » Coroutines and tasks テーマ 自動 ライト ダーク | Coroutines and tasks ¶ ... IO-bound functions/methods that would otherwise block the event loop if they were run in the main thread. For example: def blocking_io (): print ( f "start blocking_io at { time . strftime ( ' %X ' ) } " ) # Note that time.sleep() can be replaced with an ... y blocking # IO-bound operation, such as file operations. time . sleep ( 1 ) print ( f "blocking_io complete at { time . strftime ( ' ... def main (): print ( f "started main at { time . strftime ( ' %X ' ) } " ) await asyncio . gather ( asyncio . to_thread ( blocking_io ), asyncio . sleep ( 1 )) print ( f "finished main at { time . strftime ( ' %X ' ) } " ) asyncio . run ( main ()) # Exp ...
https://man.mtool.work/python/3.14/library/asyncio-task.html
Thread states and the global interpreter lock — Python 3.14.8 ドキュメント 8598
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » Thread states and the global interpreter lock テーマ 自動 ライト ダーク | Thread states and the global interpreter lock ¶ Unless ... cks are also necessary for thread-safety in pure-Python code. Additionally, the global interpreter lock is released around blocking I/O operations, such as reading or writing to a file. From the C API, this is done by detaching the thread state . The Pyt ... manipulating the thread state has the following simple structure: Save the thread state in a local variable . ... Do some blocking I / O operation ... Restore the thread state from the local variable . この構造は非常に一般的なので、作業を単純にするために ... 2つのマクロが用意されています: Py_BEGIN_ALLOW_THREADS ... Do some blocking I / O operation ... Py_END_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS マクロは新たなブロックを開始し、隠しローカル変数を宣言しま ...
https://man.mtool.work/python/3.14/c-api/threads.html
timer file descriptor HOWTO — Python 3.14.8 ドキュメント 8598
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » timer file descriptor HOWTO テーマ 自動 ライト ダーク | timer file descriptor HOWTO ¶ リリース : 1.13 This HOWTO discusses Python's support for th ... s how to use a timer file descriptor to execute a function twice a second: # Practical scripts should use really use a non-blocking timer, # we use a blocking timer here for simplicity. import os , time # Create the timer file descriptor fd = os . timerf ... host. # sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) sock . bind (( "127.0.0.1" , 1234 )) sock . setblocking ( False ) sock . listen ( 1 ) ep . register ( sock , select . EPOLLIN ) # Create timer file descriptors in non-blocking mo ... heck if there is a connection request. print ( f "Accepting connection { fd } " ) conn , addr = sock . accept () conn . setblocking ( False ) print ( f "Accepted connection { conn } from { addr } " ) ep . register ( conn , select . EPOLLIN ) elif conn an ...
https://man.mtool.work/python/3.14/howto/timerfd.html
io --- ストリームを扱うコアツール — Python 3.14.8 ドキュメント 8598
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 汎用オペレーティングシステムサービス » io --- ストリームを扱うコアツール テーマ 自動 ライト ダーク | io --- ストリームを扱うコアツー ... ジェクトはインメモリーのテキストストリームです: f = io . StringIO ( "some initial text data" ) 注釈 When working with a non-blocking stream, be aware that read operations on text I/O objects might raise a BlockingIOError if the stream cannot perform the o ... 0. バージョン 3.11 で変更: text_encoding() returns "utf-8" when UTF-8 mode is enabled and encoding is None . exception io. BlockingIOError ¶ 互換性のための、組み込みの BlockingIOError 例外のエイリアスです。 exception io. UnsupportedOperation ¶ OSError と ... 場合はストリームに対して複数の呼び出しをします。 If 0 bytes are returned this indicates end of file. If the object is in non-blocking mode and the underlying read() returns None indicating no bytes are available, None is returned. readinto ( b , / ) ¶ Read ...
https://man.mtool.work/python/3.14/library/io.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT