Asynchronous programming in .NET
Twitter @GerardoLijs C# MeetUp Barcelona April 2019 Content What is Asynchronous Programming CPU-bound vs IO-bound Obsolete patterns Tasks and async/await Practical use cases • Responsive user interfaces • Scalability and performance in web applications @GerardoLijs CPU-bound operations • Use Task.Run to execute expensive CPU-bound code in the ThreadPool • Define a Task returning method • In general the time you will need asynchronous to deal with IO-bound operations and the times you will use CPU-bound operations you will probably use a library that provides asynchronous methods for you to interact0 码力 | 29 页 | 942.73 KB | 1 年前3C++高性能并行编程与优化 - 课件 - 07 深入浅出访存优化
p 课程 PPT 和代码: https://github.com/parallel101/course 为什么往 int 数组里赋值 1 比赋值 0 慢一倍? 第 1 章:内存带宽 cpu-bound 与 memory-bound • 通常来说,并行只能加速计算的部分,不能加速内存读写的部分 。 • 因此,对 fill 这种没有任何计算量,纯粹只有访存的循环体,并 行没有加速效果。称为内存瓶颈( • 因为局部数组的大小远远小于一级缓存,这样迭代时 读写的带宽就是一级缓存的速度,几乎没有影响。 • 这里一次循环体直接相当于 16 次迭代,两次就完了。 但是可能加的有点过头变成 cpu-bound 了,所以只快 了 10 倍左右,大家掌握里面的思想就好。 进一步优化 • 用了一些常量作为参数,调整一下局部数组的大小。 • 加速比: 16 倍,大概已经到极限了? 进亿步优化 •0 码力 | 147 页 | 18.88 MB | 1 年前3Node.js - the core
“provides an asynchronous, evented and/or continuation passing style API for moving blocking/longish CPU-bound tasks out of Node's event loop to JavaScript threads that run in parallel in the background and0 码力 | 124 页 | 7.87 MB | 1 年前3Falcon v3.1.1-b3 Documentation
ProcessPoolExecutor is another alternative for long running tasks that do not release the GIL, such as CPU-bound pure Python code. Note, however, that ProcessPoolExecutor builds upon the multiprocessing mod- ule AbstractEventLoop.set_default_executor() is used to change it to something else. Due to the GIL, CPU-bound jobs will block request processing for the current process unless the default Executor is changed Warning: This helper is only to be used for functions that do not perform any blocking I/O or lengthy CPU-bound operations, since the entire async loop will be blocked while the wrapped function is executed.0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.1-b1 Documentation
ProcessPoolExecutor is another alternative for long running tasks that do not release the GIL, such as CPU-bound pure Python code. Note, however, that ProcessPoolExecutor builds upon the multiprocessing mod- ule AbstractEventLoop.set_default_executor() is used to change it to something else. Due to the GIL, CPU-bound jobs will block request processing for the current process unless the default Executor is changed Warning: This helper is only to be used for functions that do not perform any blocking I/O or lengthy CPU-bound operations, since the entire async loop will be blocked while the wrapped function is executed.0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.1-a Documentation
ProcessPoolExecutor is another alternative for long running tasks that do not release the GIL, such as CPU-bound pure Python code. Note, however, that ProcessPoolExecutor builds upon the multiprocessing mod- ule AbstractEventLoop.set_default_executor() is used to change it to something else. Due to the GIL, CPU-bound jobs will block request processing for the current process unless the default Executor is changed Warning: This helper is only to be used for functions that do not perform any blocking I/O or lengthy CPU-bound operations, since the entire async loop will be blocked while the wrapped function is executed.0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.0 Documentation
ProcessPoolExecutor is another alternative for long running tasks that do not release the GIL, such as CPU-bound pure Python code. Note, however, that ProcessPoolExecutor builds upon the multiprocessing mod- ule AbstractEventLoop.set_default_executor() is used to change it to something else. Due to the GIL, CPU-bound jobs will block request processing for the current process unless the default Executor is changed Warning: This helper is only to be used for functions that do not perform any blocking I/O or lengthy CPU-bound operations, since the entire async loop will be blocked while the wrapped function is executed.0 码力 | 362 页 | 1.29 MB | 1 年前3Falcon v3.1.1 Documentation
ProcessPoolExecutor is another alternative for long running tasks that do not release the GIL, such as CPU-bound pure Python code. Note, however, that ProcessPoolExecutor builds upon the multiprocessing mod- ule AbstractEventLoop.set_default_executor() is used to change it to something else. Due to the GIL, CPU-bound jobs will block request processing for the current process unless the default Executor is changed Warning: This helper is only to be used for functions that do not perform any blocking I/O or lengthy CPU-bound operations, since the entire async loop will be blocked while the wrapped function is executed.0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.1-rc1 Documentation
ProcessPoolExecutor is another alternative for long running tasks that do not release the GIL, such as CPU-bound pure Python code. Note, however, that ProcessPoolExecutor builds upon the multiprocessing mod- ule AbstractEventLoop.set_default_executor() is used to change it to something else. Due to the GIL, CPU-bound jobs will block request processing for the current process unless the default Executor is changed Warning: This helper is only to be used for functions that do not perform any blocking I/O or lengthy CPU-bound operations, since the entire async loop will be blocked while the wrapped function is executed.0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.0.0-b1 Documentation
ProcessPoolExecutor] is another alternative for long running tasks that do not release the GIL, such as CPU-bound pure Python code. Note, however, that ProcessPoolExecutor [https://docs.python.org/3/library/concurrent AbstractEventLoop.set_default_executor() is used to change it to something else. Due to the GIL, CPU-bound jobs will block request processing for the current process unless the default Executor [https://docs Warning This helper is only to be used for functions that do not perform any blocking I/O or lengthy CPU-bound operations, since the entire async loop will be blocked while the wrapped function is executed.0 码力 | 1028 页 | 725.86 KB | 1 年前3
共 115 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12