Skip to content
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

描述 std::mutex 的用词奇怪,应当更改 #284

Closed
Mq-b opened this issue May 20, 2024 · 3 comments · Fixed by #292
Closed

描述 std::mutex 的用词奇怪,应当更改 #284

Mq-b opened this issue May 20, 2024 · 3 comments · Fixed by #292

Comments

@Mq-b
Copy link
Contributor

Mq-b commented May 20, 2024

  • 文件路径:book/zh-cn/07-thread.md

web 位置

原文:

std::mutex 是 C++11 中最基本的 mutex 类,通过实例化 std::mutex 可以创建互斥量

这句话的感觉基本就是胡言乱语,虽然我能明白它要表达的意思,但这是因为我本来就知道。

  1. “《std::mutex 是最基本的 mutex》”,后文又重新使用了中文的“互斥量”,要么就都互斥量即可,何必如此抽象。

  2. 通过实例化 std::mutex 可以创建互斥量”,我本人一直不喜欢这种实例化 xxx 类型创建 xxx,何不直接说:可以使用 std::mutex 类型创建互斥量对象

总而言之,简单的描述为:

  • std::mutex 是 C++11 引入的最基本的互斥量类型,可以使用 std::mutex 创建互斥量对象
@Mq-b Mq-b changed the title 描述 std::mutex 用词没有奇怪应当更改 描述 std::mutex 用词奇怪应当更改 May 20, 2024
@Mq-b Mq-b changed the title 描述 std::mutex 用词奇怪应当更改 描述 std::mutex 的用词奇怪,应当更改 May 20, 2024
@changkun
Copy link
Owner

Thanks and PR welcome

@frederick-vs-ja
Copy link
Contributor

我们最好审核一下全书的“实例化”。按照标准的话只有模板化实体才有实例化。

@Mq-b
Copy link
Contributor Author

Mq-b commented May 30, 2024

我觉得这来自于目前广泛用词的不严谨与不统一,比如经常有说法是:

我编写了一个类型 T,并实例化了一个对象...

等等类似。我觉得这也源自对于 “实例”与“实例化”无法正确区分

前者常常表达式:“对象实例”,而后者,很多人无法意识到这实际上是个 C++ 中的专门术语。

大概也就是这样让“实例”与“实例化”混淆,使用者大多也不清楚这些用词。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants