Skip to content

zh-CN: Add new APIs to "Don't block the event loop" guide #2021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from Jan 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion locale/zh-cn/docs/guides/dont-block-the-event-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Node 模块中有如下这些 API 用到了工作线程池:
1. [DNS](https://nodejs.org/api/dns.html):`dns.lookup()`,`dns.lookupService()`。
2. [文件系统](https://nodejs.org/api/fs.html#fs_threadpool_usage):所有的文件系统 API。除 `fs.FSWatcher()` 和那些显式同步调用的 API 之外,都使用 libuv 的线程池。
2. CPU 密集型任务:
1. [Crypto](https://nodejs.org/api/crypto.html):`crypto.pbkdf2()``crypto.randomBytes()``crypto.randomFill()`。
1. [Crypto](https://nodejs.org/api/crypto.html):`crypto.pbkdf2()``crypto.scrypt()`、`crypto.randomBytes()``crypto.randomFill()`、`crypto.generateKeyPair()`。
2. [Zlib](https://nodejs.org/api/zlib.html#zlib_threadpool_usage):所有 Zlib 相关函数,除那些显式同步调用的 API 之外,都适用 libuv 的线程池。

在许多 Node 应用程序中,这些 API 是工作线程池任务的唯一来源。此外应用程序和模块可以使用 [C++ 插件](https://nodejs.org/api/addons.html) 向工作线程池提交其它任务。
Expand Down