Comprehensive Rust(繁体中文)而非輪詢。非同步的 Python 程式需要「迴圈(loop)」來處理,類似於 Rust 的執行環境。 • JavaScript 的 Promise 也是類似的概念,但仍是基於回呼函數。JavaScript 的語言執行環境實 作了事件迴圈(event loop),所以隱藏了很多關於 Promise 的處理細節。 63.1 async/await 從高層次的角度來看,非同步的 Rust 程式碼看起來很像「一般的」同步程式碼: 因此大部分有趣的非同步作業皆無法在 Playground 中執行。 • 除非接受執行器輪詢,否則 Future 不會執行任何作業 (甚至不會啟動 I/O 作業),因此 Future 是 「惰性」的。這一點與 JS Promise 不同。舉例來說,後者即使從未使用過,仍會執行至完成為止。 63.3.1 Tokio Tokio 提供以下項目: • 執行非同步程式碼的多執行緒執行階段。 • 標準程式庫的非同步版本。 • 作的功能類似於獨立的執行作業執行緒。 • 會合 • 選取 64.1 加入 會合作業會等待整個 Future 集合準備就緒,然後蒐集多個結果一次回傳。這類似於 JavaScript 中的 Promise.all 或 Python 中的 asyncio.gather。 use anyhow::Result; use futures::future; use reqwest; use std::0 码力 | 358 页 | 1.41 MB | 10 月前3
julia 1.10.10results. This corresponds to the -ffast-math option of clang. • Write @simd in front of for loops to promise that the iterations are independent and may be re- ordered. Note that in many cases, Julia can automatically JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim) JL_ALWAYS_LEAFTYPE; JL_GC_PROMISE_ROOTED This is a function-like annotation. Any value passed to this annotation will be considered happen to know for complicated external reasons // that val is rooted under these conditions JL_GC_PROMISE_ROOTED(val); } } Completeness of analysis The analyzer only looks at local information. In particular0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.10.9results. This corresponds to the -ffast-math option of clang. • Write @simd in front of for loops to promise that the iterations are independent and may be re- ordered. Note that in many cases, Julia can automatically JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim) JL_ALWAYS_LEAFTYPE; JL_GC_PROMISE_ROOTED This is a function-like annotation. Any value passed to this annotation will be considered happen to know for complicated external reasons // that val is rooted under these conditions JL_GC_PROMISE_ROOTED(val); } } Completeness of analysis The analyzer only looks at local information. In particular0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.11.4results. This corresponds to the -ffast-math option of clang. • Write @simd in front of for loops to promise that the iterations are independent and may be re- ordered. Note that in many cases, Julia can automatically JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim) JL_ALWAYS_LEAFTYPE; JL_GC_PROMISE_ROOTED This is a function-like annotation. Any value passed to this annotation will be considered happen to know for complicated external reasons // that val is rooted under these conditions JL_GC_PROMISE_ROOTED(val); } } Completeness of analysis The analyzer only looks at local information. In particular0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentationresults. This corresponds to the -ffast-math option of clang. • Write @simd in front of for loops to promise that the iterations are independent and may be re- ordered. Note that in many cases, Julia can automatically JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim) JL_ALWAYS_LEAFTYPE; JL_GC_PROMISE_ROOTED This is a function-like annotation. Any value passed to this annotation will be considered happen to know for complicated external reasons // that val is rooted under these conditions JL_GC_PROMISE_ROOTED(val); } } Completeness of analysis The analyzer only looks at local information. In particular0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.6 Release Notesresults. This corresponds to the -ffast-math option of clang. • Write @simd in front of for loops to promise that the iterations are independent and may be re- ordered. Note that in many cases, Julia can automatically JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim) JL_ALWAYS_LEAFTYPE; JL_GC_PROMISE_ROOTED This is a function-like annotation. Any value passed to this annotation will be considered happen to know for complicated external reasons // that val is rooted under these conditions JL_GC_PROMISE_ROOTED(val); } } Completeness of analysis The analyzer only looks at local information. In particular0 码力 | 2007 页 | 6.73 MB | 3 月前3
julia 1.13.0 DEVresults. This corresponds to the -ffast-math option of clang. • Write @simd in front of for loops to promise that the iterations are independent and may be re- ordered. Note that in many cases, Julia can automatically JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim) JL_ALWAYS_LEAFTYPE; JL_GC_PROMISE_ROOTED This is a function-like annotation. Any value passed to this annotation will be considered happen to know for complicated external reasons // that val is rooted under these conditions JL_GC_PROMISE_ROOTED(val); } }CHAPTER 106. DOCUMENTATION OF JULIA'S INTERNALS 1974 Completeness of analysis0 码力 | 2058 页 | 7.45 MB | 3 月前3
Julia 1.12.0 RC1results. This corresponds to the -ffast-math option of clang. • Write @simd in front of for loops to promise that the iterations are independent and may be re- ordered. Note that in many cases, Julia can automatically JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim) JL_ALWAYS_LEAFTYPE; JL_GC_PROMISE_ROOTED This is a function-like annotation. Any value passed to this annotation will be considered happen to know for complicated external reasons // that val is rooted under these conditions JL_GC_PROMISE_ROOTED(val); } } Completeness of analysis The analyzer only looks at local information. In particular0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta4results. This corresponds to the -ffast-math option of clang. • Write @simd in front of for loops to promise that the iterations are independent and may be re- ordered. Note that in many cases, Julia can automatically JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim) JL_ALWAYS_LEAFTYPE; JL_GC_PROMISE_ROOTED This is a function-like annotation. Any value passed to this annotation will be considered happen to know for complicated external reasons // that val is rooted under these conditions JL_GC_PROMISE_ROOTED(val); } } Completeness of analysis The analyzer only looks at local information. In particular0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta3results. This corresponds to the -ffast-math option of clang. • Write @simd in front of for loops to promise that the iterations are independent and may be re- ordered. Note that in many cases, Julia can automatically JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim) JL_ALWAYS_LEAFTYPE; JL_GC_PROMISE_ROOTED This is a function-like annotation. Any value passed to this annotation will be considered happen to know for complicated external reasons // that val is rooted under these conditions JL_GC_PROMISE_ROOTED(val); } } Completeness of analysis The analyzer only looks at local information. In particular0 码力 | 2057 页 | 7.44 MB | 3 月前3
共 11 条
- 1
- 2













