gpt4 book ai didi

c++ - 使用 std::deque 或 std::priority_queue 是线程安全的吗?

转载 作者:可可西里 更新时间:2023-11-01 15:47:58 25 4
gpt4 key购买 nike

<分区>

Possible Duplicates:
Is the C++ STL std::set thread-safe?
Thread safety for STL queue

我猜不是,我只是想确定一下。意味着 2 个线程使用 相同的 std::deque,同时使用 std::deque::push_backpush_front

std::priority_queue 和函数 std::priority_queue::pushstd::priority_queue::pop 也有同样的问题..

这些容器是线程安全的吗?或者我应该亲自将其编程为线程安全的?

非常感谢。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com