
C++11
秦钟
这个作者很懒,什么都没留下…
展开
-
C++11新标准线程库之方法一
//并发//两个或者更多的任务(独立的活动)同时发生(进行)//一个程序同时执行多个独立任务//单核CPU,并发的假象,这种上下文切换是有时间开销的//多核;一块芯片上有双核,4核,8,16//1. 多进程并发//多个进程实现并发//打开多个word ,打开多个IE浏览器//账号服务器,游戏逻辑服务器,服务器之间的通信//进程:(同一台电脑:管道,文件,消息对列,共享内存//...原创 2019-06-06 19:09:32 · 969 阅读 · 0 评论 -
Google Protobuf 3版本介绍
Google Protobuf 3版本介绍本文编写时, Google 官方的 protobuf 版本是3.0.0beta下面介绍下proto3的一些细节变化Proto3的语法变化语法标记这个版本的protoc的protobuf编译器已经可以支持proto2语法和proto3的语法如果你的proto文件没有添加syntax说明的话, 用这个版本的编译器会报错, 提示你默认prot...翻译 2019-08-19 11:50:56 · 2940 阅读 · 0 评论 -
google::protobuf的使用 c+ https://blog.youkuaiyun.com/u011573853/article/details/73060934
// 如果使用此注释,则使用proto3; 否则使用proto2syntax = "proto3";// 引入外部的proto对象import "google/protobuf/any.proto";// 生成类的包名option java_package = "proto.complex";//生成的数据访问类的类名 option java_outer_classname...原创 2019-08-16 17:44:12 · 768 阅读 · 0 评论 -
protobuf的使用
int main(int argc, char *argv[]){ GOOGLE_PROTOBUF_VERIFY_VERSION; string filename("D:\\prototest1.txt"); //序列化保存到本地文件 fstream output(filename, ios::out | ios::trunc | ios::binary); ComplexOb...原创 2019-08-19 10:57:44 · 212 阅读 · 0 评论 -
std::atomic<int> m_count 原子操作
#include<cstdio>#include<cstdlib>#include<iostream>#include <thread>#include <mutex>#include <list>#include <atomic>using namespace std;class A{...原创 2019-06-18 19:13:50 · 975 阅读 · 0 评论 -
gitlab的安装 centos7安装Nginx
centos7安装Nginxhttps://www.cnblogs.com/kaid/p/7640723.htmlgitlab的安装https://blog.youkuaiyun.com/duyusean/article/details/80011540注意IP是外网IP,还有端口号,阿里云禁止80端口,要注意编辑gitlab的配置vi /etc/gitlab/gitlab.rb...转载 2019-06-16 17:38:05 · 391 阅读 · 0 评论 -
c++ 智能指针
https://blog.youkuaiyun.com/xu1105775448/article/details/80625936转载 2019-06-09 16:21:34 · 152 阅读 · 0 评论 -
单例 多线程 互斥 之 call_once(不建义)
#include<cstdio>#include<cstdlib>#include<iostream>#include <thread>#include <mutex>#include <list>using namespace std;std::mutex m_mutex;std::once_fla...原创 2019-06-09 16:10:59 · 270 阅读 · 0 评论 -
单例 多线程 互斥
#include<cstdio>#include<cstdlib>#include<iostream>#include <thread>#include <mutex>#include <list>using namespace std;std::mutex m_mutex;class MySign...原创 2019-06-09 15:58:31 · 232 阅读 · 0 评论 -
c++11 线程保护,入口,; 智能指针
//传递类参数,智能指针作为线程参数#include<cstdio>#include<cstdlib>#include<iostream>#include <thread>#include <mutex>#include <list>using namespace std;class A{publi...原创 2019-06-09 14:47:00 · 291 阅读 · 0 评论 -
一个规模大的计算任务 std::async
//一个规模大的计算任务//std::async很方便,把更多的计算工作放在更多的肩上来承担。//下面例子中演示了四个异步调用对标积的计算#include <chrono>#include <iostream>#include <future>#include <random>#include <vector>#inc...原创 2019-06-18 21:05:48 · 177 阅读 · 0 评论 -
std::future的使用
//传递类参数,智能指针作为线程参数#include<cstdio>#include<cstdlib>#include<iostream>#include <thread>#include <future>using namespace std;void f(int n){ cout << n <...原创 2019-06-18 20:39:34 · 1002 阅读 · 0 评论 -
C++11新标准线程库之方法五
#include<cstdio>#include<cstdlib>#include<iostream>#include <thread>using namespace std;class A{public: //类型转换构造函数 A(int i) :m_i(i) { cout << "构造函数执行"<&...原创 2019-06-06 19:48:28 · 363 阅读 · 0 评论 -
C++11新标准线程库之方法四 - 有参数
#include<cstdio>#include<cstdlib>#include<iostream>#include <thread>using namespace std;void myprint(const int & i, char * pmybuf){ cout << i << endl;...原创 2019-06-06 19:33:08 · 197 阅读 · 0 评论 -
C++11新标准线程库之方法三
#include<cstdio>#include<cstdlib>#include<iostream>#include <thread>using namespace std;int main(){ auto mylamthread = []{ cout << "Start" << endl;...原创 2019-06-06 19:25:54 · 234 阅读 · 0 评论 -
C++11新标准线程库之方法二
#include<cstdio>#include<cstdlib>#include<iostream>#include <thread>using namespace std;class TA{public: TA(int i) { cout << i << endl; } void opera...原创 2019-06-06 19:19:59 · 169 阅读 · 0 评论 -
go语言的学习day01
go语言的学习一、day011.变量声明:package mainimport "fmt"var nWher = "test my "//定义二个返回值func foo()(string,int) { return "alx",9000}func main() { //声明必须要使用 var name string var age int //批量声明 必须要...原创 2019-08-22 09:58:03 · 252 阅读 · 0 评论