Q:

std::thread fs_module(fs_process, prob_orig, fb_sz, line_num, probp, plabel, std::ref(confidence_level)) ;
fs_module.detach();

A:

I could compile your code successfully with MSVC2013. However, thread() works passing copies of its argument to the new thread. This means that if your code would compile on your compiler,

each thread wourd run with its own copy of ht, so that at the end, main's ht would be empty.GCC doesn't compile with this weird message. You can get rid of it by using the reference wraper with thread.

This will compile succesfully. And each reference used by the threads would refer to the same object.

However, there are high chances that you'll get some runtime error or unexpected results. This is because two threads are concurently trying to insert into ht. But unordered_map is not thread safe,

so these racing conditions might cause ht to reach an unstable state (i.e. UB, i.e. potential segfault).

std::thread fs_module(fs_process, prob_orig, fb_sz, line_num, std::ref(probp), std::ref(plabel), std::ref(confidence_level)) ;
fs_module.detach();

re:

1.stackoverflow;

2./usr/include/c++/4.8/functional:1697:61: error: no type named ‘type’ in ‘class std::result_of<std::_Mem_fn<void;

【error】no type named ‘type’ in ‘class std::result_of<void的更多相关文章

  1. 【error】Invalid ADAPTORNAME specified. Type 'imaqhwinfo' for a list of available ADAPTORNAMEs.

    前言 使用matlab通过摄像头获取图像进行处理: 问题描述 使用matalb调用摄像头时出现错误: >> imaqhwinfo Warning: No Image Acquisition ...

  2. 【ERROR】no matching function for call to 'std::basic_ifstream<char>::basic_ifstream

    错误记录:QT中使用 no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(QString ...

  3. /usr/include/c++/4.8/functional:1697:61: error: no type named ‘type’ in ‘class std::result_of<std::_Mem_fn<void

    /usr/include/c++/4.8/functional:1697:61: error: no type named ‘type’ in ‘class std::result_of<std ...

  4. laravel 【error】MethodNotAllowedHttpException No message

    Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message 报错原因[原理]CSRF ...

  5. 【Error】IOError: [Errno 22] invalid mode ('wb') or filename

    错误描述: IOError: [Errno 22] invalid mode ('wb') or filename: 'C:\\Users\\Viral Patel\\Documents\\GitHu ...

  6. 【原创】js中input type=file的一些问题

    1.介绍 在开发中,文件上传必不可少,input[type=file] 是常用的上传标签,但是它长得又丑.浏览的字样不能换,但是他长得到底有多丑呢.我们来看看在不同浏览器里的样子吧. <inpu ...

  7. 【Elasticsearch】清空指定index/type下的数据

    1.postman请求接口 http://ip:端口/index/type/_delete_by_query?conflicts=proceed body为: { "query": ...

  8. 【HDOJ】2577 How to Type

    DP. /* 2577 */ #include <cstdio> #include <cstring> #include <cstdlib> #define MAX ...

  9. 【ERROR】使用jquery的ajax出现error:readyState=4,status=500

    使用jquery的ajax出现error:readyState=4,status=500,ajax代码如下: $.ajax({ url : "../toBeFinMisManage/show ...

随机推荐

  1. 模型层model layer

    题外话: Django的教程写到这里,就进入了整体的第二部分,也是最关键的部分.此时有一个问题必须想清楚,那就是,以项目带动内容还是以参考书目的方式展开?为此,我考虑了很久. 我在开始学习Django ...

  2. Lua和C++交互 学习记录之一:C++嵌入脚本

    主要内容转载自:子龙山人博客(强烈建议去子龙山人博客完全学习一遍) 部分内容查阅自:<Lua 5.3  参考手册>中文版 译者 云风 制作 Kavcc vs2013+lua-5.3.3 1 ...

  3. Oracle 千万级别数据查询优化

    说明:平时很少接触到大数据分页,今天有兴趣在数据库插入1000万条数据进行测试,经过查询相关资料得到如下说明:笔者在工作中有一上百万条记录的表,在jsp页面中需对该表进行分页显示,便考虑用rownum ...

  4. Eclipse 中 SDK无法更新---解决方法

    在SDK Manager -> tools -> options中: HTTP Proxy Server: mirrors.neusoft.edu.cn HTTP Proxy Port: ...

  5. nginx File not found 错误

    使用php-fpm解析PHP,"No input file specified","File not found"是令nginx新手头疼的常见错误,原因是php ...

  6. Android设置全局Context

    新建一个java继承Application类 import android.app.Application; import android.content.Context; /** * 编写自定义Ap ...

  7. 44 CSS 浮动 模态框 定位

    一.浮动 float : 浮动的盒子不占原来的位置,其下方的盒子会上移 父盒子会发生塌陷现象.同一级盒子right浮动,同级左边的盒子需要左浮动,right浮动的盒子才能上来 由于浮动框不在文档的普通 ...

  8. gradle 编译 No such property: sonatypeUsername错误解决

    No such property: sonatypeUsername for class: org.gradle.api.publication.maven.internal.ant.DefaultG ...

  9. python-day32--进程--->socker并发

    一.进程背景 1.进程即正在执行的一个过程.进程是对正在运行程序的一个抽象. 2.进程的概念起源于操作系统,是操作系统最核心的概念,也是操作系统提供的最古老也是最重要的抽象概念之一.操作系统的其他所有 ...

  10. 登录XML

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orient ...