
C++ 多线程
位面元哥
三十功名尘与土 ,八千里路云和月
展开
-
C++多线程,创建线程std::thread
#include <iostream> #include <thread> #include <unistd.h> #include <map> class A { private: int m_a = 100; std::thread m_t; bool m_run_flag = true...原创 2020-01-19 14:28:12 · 1539 阅读 · 0 评论 -
C++多线程,创建线程
文章目录线程函数在类里面1,创建线程 std ::thread2,类3,类函数定义 线程函数在类里面 1,创建线程 std ::thread // create a thread to read image by videocapture ReadFifo fifo_1(fifo_queue, FIFO_PATH_1, pipeline_run_flag); std::t...原创 2019-06-25 18:33:20 · 418 阅读 · 0 评论 -
C++多线程,为线程绑定cpu
文章目录1,使用2,函数 1,使用 set_cpu("detector", {0, 1, 2}); 2,函数 void set_cpu(std::string thread_name, std::vector<short> cpu_ids) { int i, cpus = 0; cpu_set_t mask; cpu_set_t get; cpus...原创 2019-06-25 18:40:12 · 4179 阅读 · 1 评论 -
C++多线程,多线程通信,队列
文章目录1,使用2,实现3,知识点1, std::mutex2,std::condition_variable 1,使用 TQueueConcurrent<std::vector<std::string>> fifo_queue; ... ... fifo_queue.emplace_back(string_ret); LOG(INFO) << "fi...原创 2019-06-25 19:19:18 · 3539 阅读 · 0 评论