ConcurrentHashMap for c ++ [英] ConcurrentHashMap for c++

查看:138
本文介绍了ConcurrentHashMap for c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有任何ConcurrentHashMap for c ++实现或类似的东西?

Is there any ConcurrentHashMap for c++ implementation or something of similar anywhere?

我不明白为什么c ++中的多线程比Java更难。

I can't understand why multithreading in c++ is so hard than Java!

推荐答案

线程并不真正支持C ++,所以在标准中没有任何关于线程安全容器。

Threads arent really supported in C++ so there isnt anything in the standard about thread safe containers. People have obviously made them before.

我认为Intel的这个东西可能会帮助 http://www.threadingbuildingblocks.org/

I think this thing from Intel may help http://www.threadingbuildingblocks.org/

我还没有使用它,所以没有担保人。

I have not used it myself yet so no guarentees.

您也可以在自己的类中使用信号量将任何容器包装成线程安全。

You can also just wrap any container in your own class with a semaphore to make it thread safe.

祝你好运。

这篇关于ConcurrentHashMap for c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆