Comprehensive Rust(繁体中文)
. . . . . . . . . . . . . . . . . . . . . . . . . . 320 XIV 並行:下午 326 63 非同步的 Rust 327 63.1 async/await . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 63.2 Futures . . . 64.2 選取 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 65 async/await 的問題 335 65.1 阻塞執行器 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 bare-metal (嵌入式系統) 上台開發。課程 內容包含微控制器和處理器。 • 並行:這個全天課程著重於 Rust 中的並行問題。我們將探討傳統並行 (使用執行緒和互斥鎖進行先 占式排程) 以及 async/await 並行 (使用 future 進行合作多工處理)。 非課程目標 Rust 是大型的程式語言,無法在幾天內就介紹完畢。因此,本課程不包含下列內容: • 學習如何開發巨集 (macro)。請直接閱讀0 码力 | 358 页 | 1.41 MB | 10 月前3julia 1.10.10
other operations that use f(x): julia> g(x) = f(x) g (generic function with 1 method) julia> t = @async f(wait()); yield(); Now we add some new methods to f(x): julia> f(x::Int) = "definition for Int" julia> g(1) "definition for Int" julia> fetch(schedule(t, 1)) "original definition" julia> t = @async f(wait()); yield(); julia> fetch(schedule(t, 1)) "definition for Int"CHAPTER 12. METHODS 160 12 package called Sockets. Let's first create a simple server: julia> using Sockets julia> errormonitor(@async begin server = listen(2000) while true sock = accept(server) println("Hello World\n") end end)0 码力 | 1692 页 | 6.34 MB | 3 月前3Julia 1.10.9
other operations that use f(x): julia> g(x) = f(x) g (generic function with 1 method) julia> t = @async f(wait()); yield(); Now we add some new methods to f(x): julia> f(x::Int) = "definition for Int" julia> g(1) "definition for Int" julia> fetch(schedule(t, 1)) "original definition" julia> t = @async f(wait()); yield(); julia> fetch(schedule(t, 1)) "definition for Int"CHAPTER 12. METHODS 160 12 package called Sockets. Let's first create a simple server: julia> using Sockets julia> errormonitor(@async begin server = listen(2000) while true sock = accept(server) println("Hello World\n") end end)0 码力 | 1692 页 | 6.34 MB | 3 月前3Julia 1.11.4
other operations that use f(x): julia> g(x) = f(x) g (generic function with 1 method) julia> t = @async f(wait()); yield(); Now we add some new methods to f(x): julia> f(x::Int) = "definition for Int" julia> g(1) "definition for Int" julia> fetch(schedule(t, 1)) "original definition" julia> t = @async f(wait()); yield(); julia> fetch(schedule(t, 1)) "definition for Int" 13.6 Design Patterns with package called Sockets. Let's first create a simple server: julia> using Sockets julia> errormonitor(@async begin server = listen(2000) while true sock = accept(server) println("Hello World\n") end end)0 码力 | 2007 页 | 6.73 MB | 3 月前3Julia 1.11.5 Documentation
other operations that use f(x): julia> g(x) = f(x) g (generic function with 1 method) julia> t = @async f(wait()); yield(); Now we add some new methods to f(x): julia> f(x::Int) = "definition for Int" julia> g(1) "definition for Int" julia> fetch(schedule(t, 1)) "original definition" julia> t = @async f(wait()); yield(); julia> fetch(schedule(t, 1)) "definition for Int" 13.6 Design Patterns with package called Sockets. Let's first create a simple server: julia> using Sockets julia> errormonitor(@async begin server = listen(2000) while true sock = accept(server) println("Hello World\n") end end)0 码力 | 2007 页 | 6.73 MB | 3 月前3Julia 1.11.6 Release Notes
other operations that use f(x): julia> g(x) = f(x) g (generic function with 1 method) julia> t = @async f(wait()); yield(); Now we add some new methods to f(x): julia> f(x::Int) = "definition for Int" julia> g(1) "definition for Int" julia> fetch(schedule(t, 1)) "original definition" julia> t = @async f(wait()); yield(); julia> fetch(schedule(t, 1)) "definition for Int" 13.6 Design Patterns with package called Sockets. Let's first create a simple server: julia> using Sockets julia> errormonitor(@async begin server = listen(2000) while true sock = accept(server) println("Hello World\n") end end)0 码力 | 2007 页 | 6.73 MB | 3 月前3julia 1.12.0 beta1
other operations that use f(x): julia> g(x) = f(x) g (generic function with 1 method) julia> t = @async f(wait()); yield(); Now we add some new methods to f(x): julia> f(x::Int) = "definition for Int" julia> g(1) "definition for Int" julia> fetch(schedule(t, 1)) "original definition" julia> t = @async f(wait()); yield(); julia> fetch(schedule(t, 1)) "definition for Int" 13.6 Design Patterns with Base.AsyncCondition() wait(cond) The callback you pass to C should only execute a ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any allocations or other interactions0 码力 | 2047 页 | 7.41 MB | 3 月前3Julia 1.12.0 RC1
Base.AsyncCondition() wait(cond) The callback you pass to C should only execute a ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any allocations or other interactions interactions with the Julia runtime. Note that events may be coalesced, so multiple calls to uv_async_send may result in a single wakeup notification to the condition. 28.17 More About Callbacks For more (alias for Array{UInt32, 1}) julia> procstate === global_state() true julia> procstate === fetch(@async global_state()) true source Base.OncePerTask – Type. OncePerTask{T}(init::Function)() -> T Calling0 码力 | 2057 页 | 7.44 MB | 3 月前3Julia 1.12.0 Beta4
Base.AsyncCondition() wait(cond) The callback you pass to C should only execute a ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any allocations or other interactions interactions with the Julia runtime. Note that events may be coalesced, so multiple calls to uv_async_send may result in a single wakeup notification to the condition. 28.17 More About Callbacks For more (alias for Array{UInt32, 1}) julia> procstate === global_state() true julia> procstate === fetch(@async global_state()) true source Base.OncePerTask – Type. OncePerTask{T}(init::Function)() -> T Calling0 码力 | 2057 页 | 7.44 MB | 3 月前3Julia 1.12.0 Beta3
Base.AsyncCondition() wait(cond) The callback you pass to C should only execute a ccall to :uv_async_send, passing cond.handle as the argument, taking care to avoid any allocations or other interactions interactions with the Julia runtime. Note that events may be coalesced, so multiple calls to uv_async_send may result in a single wakeup notification to the condition. 28.17 More About Callbacks For more (alias for Array{UInt32, 1}) julia> procstate === global_state() true julia> procstate === fetch(@async global_state()) true source Base.OncePerTask – Type. OncePerTask{T}(init::Function)() -> T Calling0 码力 | 2057 页 | 7.44 MB | 3 月前3
共 11 条
- 1
- 2