自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(155)
  • 资源 (38)
  • 收藏
  • 关注

转载 [zz】分布式系统的raft算法

原帖地址:https://www.jdon.com/artichect/raft.html 分布式系统的Raft算法  过去, Paxos一直是分布式协议的标准,但是Paxos难于理解,更难以实现,Google的分布式锁系统Chubby作为Paxos实现曾经遭遇到很多坑。  来自Stanford的新的分布式协议研究称为Raft,它是一个为真实世界应用建立的协议,主要注重协议的落地性...

2018-09-21 16:12:12 367 1

转载 【zz】Recv-Q&Send-Q

 原帖地址:https://blog.csdn.net/acmer1183/article/details/52014216 最近线上某些服务器老是报cpu load高,同机房其他机器却没有问题。排查发现以下异常ss -nlRecv-Q Send-Q                 Local Address:Port                   Peer Addr...

2018-09-18 11:05:27 407

转载 【zz】dpdk全面分析

文章转载自https://www.cnblogs.com/bakari/p/8404650.htmlPS:欢迎大家关注我的公众号:aCloudDeveloper,专注技术分享,努力打造干货分享平台,二维码在文末可以扫,谢谢大家。高性能网络技术随着云计算产业的异军突起,网络技术的不断创新,越来越多的网络设备基础架构逐步向基于通用处理器平台的架构方向融合,从传统的物理网络到虚拟网络,从...

2018-09-10 08:55:32 5126

原创 brpc:countdown event acquire release

 acquire 是要求下面的语句不能优化后跑到上面来;release是要求上面的语句优化后,不能跑到下面去; // bthread - A M:N threading library to make applications more concurrent.// Copyright (c) 2016 Baidu, Inc.// // Licensed under the A...

2018-09-07 11:15:25 522

转载 [zz]Acquire and Release Semantics

http://preshing.com/20120913/acquire-and-release-semantics/Acquire and Release SemanticsGenerally speaking, in lock-free programming, there are two ways in which threads can manipulate shared memo...

2018-08-13 18:53:32 220

转载 [zz]The Synchronizes-With Relation

 from:http://preshing.com/20130823/the-synchronizes-with-relation/ The Synchronizes-With RelationIn an earlier post, I explained how atomic operations let you manipulate shared variables con...

2018-08-13 18:52:51 427

转载 【zz】浅析C++多线程内存模型

 原地址:http://www.parallellabs.com/2011/08/27/c-plus-plus-memory-model/ 浅析C++多线程内存模型注:本文发表于《程序员》2011年第6期并行编程专栏,略有删改。在即将到来的C++1x标准中,一个重大的更新就是引入了C++多线程内存模型。本文的主要目的在于介绍C++多线程内存模型涉及到的一些原理和概念,以帮助...

2018-08-13 18:17:09 774

转载 log2ceiling and log2floor from brpc bits.h

// Copyright (c) 2009 The Chromium Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.// This file defines some bit ...

2018-08-08 16:42:51 318

转载 【zz】借助backtrace和demangle实现异常类Exception

转载自:http://www.codeweblog.com/%E5%80%9F%E5%8A%A9backtrace%E5%92%8Cdemangle%E5%AE%9E%E7%8E%B0%E5%BC%82%E5%B8%B8%E7%B1%BBexception/ C++的异常类是没有栈痕迹的,如果需要获取栈痕迹,需要使用以下函数:#include <execinfo.h>...

2018-08-08 16:30:29 224

原创 brpc DoublyBufferedData

ScopedPtr  析构时自动释放,本线程的锁。  保存一个wrapper到本地线程的私有变量里,析构时删除。双缓冲,空间换时间,一个用来读,一个用来写,写完后切换一下。_index 保存了读取的对象的下标。bg_index为写的对象的下标。分别为0和1,所以bg_index=!_indexWrapper 每个读线程一个。读取时,从线程本地变量中读取,如果有,则直接获取。如果没有...

2018-08-07 09:31:29 1482

原创 rdkafka 使用案例

main.cpp#include <iostream>#include <ctype.h>#include <signal.h>#include <string.h>#include <unistd.h>#include <stdlib.h>#include <syslog.h>#include

2018-07-30 13:46:41 3211 1

原创 gzip 压缩解压代码示例

#include <zlib.h>#include <iostream>#include <stdint.h>#include <string.h>#include <stdlib.h>using namespace std;#define RD_GZ_CHUNK  262144#define RD_ZERO_INIT...

2018-07-25 11:45:46 1183

转载 Linux Dynamic Shared Library && LD Linker

原帖地址: https://www.cnblogs.com/LittleHann/p/4244863.htmlLinux Dynamic Shared Library && LD Linker目录1. 动态链接的意义2. 地址无关代码: PIC3. 延迟版定(PLT Procedure Linkage Table)4. 动态链接相关结构5. 动态链接的步骤和实现6. Li...

2018-07-10 08:29:06 473

转载 [zz]美团点评智能支付核心交易系统的可用性实践

原文地址: https://www.cnblogs.com/xiexj/p/8886356.html 背景每个系统都有它最核心的指标。比如在收单领域:进件系统第一重要的是保证入件准确,第二重要的是保证上单效率。清结算系统第一重要的是保证准确打款,第二重要的是保证及时打款。我们负责的系统是美团点评智能支付的核心链路,承担着智能支付100%的流量,内部习惯称为核心交易。因为涉及美团点评所有线下交易商家...

2018-06-08 12:19:03 334

转载 [zz]一组延时数据

原文网址: http://blog.jqian.net/post/latency-trends.html一组延时数据Jan 11, 20132010年Jeff Dean在一次演讲中给出了一份所有程序员都应该了解的数据。不过这组数据其实有些过时了,Colin Scott这位有心人重新整理了一份数据,并且还是随时间变化的,对比起来看非常有意思。更新今年的数据如下:L1 cache reference ...

2018-05-16 12:05:15 175

转载 【zz】 服务器编程中的文件描述符

http://www.cnblogs.com/gaorong/p/6977814.htmllinux系统下一切皆文件,通过虚拟文件系统(VFS)的机制将所有底层屏蔽掉,用户可以通过统一的接口来实现对不同驱动的操作,对于每一个文件需要一个引用来指示,此时文件描述符应用而生,文件描述符类似于widows下的handle,对于文件的大部分操作都是通过这个描述符来操作的,例如read,write。对于每一...

2018-05-16 11:44:44 146

转载 [zz]epoll全面讲解:从实现到应用

多路复用的适用场合•     当客户处理多个描述符时(例如同时处理交互式输入和网络套接口) •     如果一个TCP服务器既要处理监听套接口,又要处理已连接套接口 •     如果一个服务器即要处理TCP,又要处理UDP •     如果一个服务器要处理多个服务或多个协议 select/poll/epoll差别poll返回的时候用户态需要轮询判断每个描述符的状态,即使只有一个描述符就绪,也要遍历...

2018-05-16 11:34:57 348

转载 printf输出%f %lld问题。输出类型和数据类型不匹配会发生什么?

原帖:http://blog.csdn.net/u011497904/article/details/42454483——总结自《C PRIMER PLUS》直接看三个例子:[cpp] view plain copyint a=4;  printf("%f  %e\n",a,

2018-01-29 09:14:07 1079

转载 Double-Checked Locking is Fixed In C++11

http://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/Double-Checked Locking is Fixed In C++11The double-checked locking pattern (DCLP) is a bit of a notorious case stu

2017-12-11 16:57:20 230

转载 The "Double-Checked Locking is Broken" Declaration Signed by: David Bacon (IBM Research) Joshua Blo

http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.htmlThe "Double-Checked Locking is Broken" DeclarationSigned by: David Bacon (IBM Research) Joshua Bloch (Javasoft), Jeff Bo

2017-12-11 16:55:17 259

转载 6.1 原子操作

http://www.epubit.com.cn/book/onlinechapter/55636.1 原子操作深入解析Android 5.0系统6.1 原子操作对简单类型的全局变量进行操作时,即使是一些简单的操作,如加法、减法等,在汇编级别上也需要多条指令才能完成。整个操作的完成需要先读取内存中的值,在CPU中计算,然后再写回内存中。如果中间发

2017-12-11 16:08:29 722

转载 内存屏障什么的

内存屏障什么的On October 28, 2010, in C语言, linux, linux系统, 系统结构, by sponge当你看到“内存屏障”四个字的时候,你的第一反应是什么?寄存器里取出了错误的值?ifence,sfence之类的指令?还是诸如volatile之类的关键字?好吧,我第一次看到这四个字的时候,脑子里浮现出的是魔兽争霸里绿油

2017-12-11 16:04:25 264

转载 浅谈Memory Reordering

原文:http://dreamrunner.org/blog/2014/06/28/qian-tan-memory-reordering/ Memory ordering在我们编写的 C/C++代码和它被在 CPU 上运行,按照一些规则,代码的内存交互会被乱序.内存乱序同时由编译器(编译时候)和处理器(运行时)造成,都为了使代码运行的更快.被编译开发者和处理

2017-12-11 11:06:22 467

原创 BinaryAnalyzer

#pragma once#include ".\NetCommuication\commuanalyzer.h"class CSzBinaryAnalyzer :  public CCommuAnalyzer{public:  CSzBinaryAnalyzer(void);  ~CSzBinaryAnalyzer(void);    /* 

2017-11-21 08:35:49 226

原创 xsdk

#if !defined(__XSDK_H__)#define __XSDK_H__//------------------------------------------------------------------------------#ifndef XSDK_OK#define XSDK_OK                 0#endif#ifn

2017-11-21 08:31:40 1119

原创 BinaryRecorder

// BinaryRecorder.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "BinaryApplication.h"#include #include using namespace std;void wait(){std::cout while ( true ){

2017-11-21 08:30:25 205

原创 BinaryApplication

#pragma once#include "CMyCriticalSection.h"#include "CCriticalSectionGuard.h"#include "FileLog.h"#include "./CustBinaryBizClass.h"#include "./NetCommuication/CommuApplica

2017-11-21 08:29:59 342

原创 AsyncLogger

#ifndef ASYNC_LOGGER_H#define ASYNC_LOGGER_H#include #include "CMyCriticalSection.h"#include "LogBlock.h"#include "ChangeBinaryAndJson.h"#include "FileLog.h"class AsyncLogger

2017-11-21 08:29:02 1201

原创 rapidjson

// Tencent is pleased to support the open source community by making RapidJSON available.// // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.//// Lic

2017-11-21 08:28:12 646

原创 NetComm-TCPConnect

#pragma once#include #include #include "CommonDefine.h"#include "CommuAnalyzer.h"#include "CommuApplication.h"#include "CCriticalSectionGuard.h"class CTCPConnect{public:  C

2017-11-21 08:27:19 411

原创 NetComm-TCPServer

#pragma once#include #include #include "tcpconnect.h"class CTCPServer :  public CTCPConnect{public:  CTCPServer(void);  ~CTCPServer(void);  friend unsigned __stdcall StartS

2017-11-21 08:26:25 329

原创 NetComm-CommuApp

#pragma once#include "CommonDefine.h"class CCommuApplication{public:  CCommuApplication(void);  virtual ~CCommuApplication(void);  /*  * Desc:   *     回调返回接收到的完整网络报文  * Pra

2017-11-21 08:25:42 267

原创 NetComm-CommDefine

#pragma once#include namespace TCPCONNECT{  enum BLOCKING_MODE  {    MODE_BLOCKING = 0,    MODE_UNBLOCKING = 1  };  enum COMMUNICATION_MODE  {    MODE_SERVER = 1, 

2017-11-21 08:24:32 388

原创 snapshot

// Copyright (c) 2011 The LevelDB Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file. See the AUTHORS file for names o

2017-10-30 13:49:27 230

原创 hqtest

#include "stdafx.h"#include "net_func.h"#include "request.h"#include #include vector> typedef unsigned int (_stdcall THREAD_START_ROUTINE)(void *); bool thread_spawn( THREAD_START_ROUTINE func

2017-10-27 16:00:14 456

原创 response

#ifndef _RESPONSE_H#define _RESPONSE_H #include set>#include map> #include "stock.h"#include "BidQuoteObserver.h" using namespace std; typedef setstring> StringSet;typedef map int, Strin

2017-10-27 15:59:49 322

原创 request

#ifndef _STOCK_REQUEST_H_#define _STOCK_REQUEST_H_ #include deque> #include "config.h"#include "stock.h"#include "NBSocket.h" using namespace std; #pragma pack(push)#pragma pack(1) class

2017-10-27 15:59:13 401

原创 net_func

#include   #include  #pragma once struct HQServerInfo{ char   szServer[32]; short iPort; int iCmdId;}; BOOL WinSockInit(); unsigned int  __stdcall GetHQAvgCost( void * pInfo  ); unsi

2017-10-27 15:58:39 264

原创 NBSocket

#ifndef _NBSOCKET_H_#define _NBSOCKET_H_ #include#includestring>#include"Channel.h" class NBSocket{public: NBSocket(); ~NBSocket(); int Connect( const char * sIP, short iPort, struct tim

2017-10-27 15:57:57 179

原创 config

#ifndef _STOCK_CONFIG_H_#define _STOCK_CONFIG_H_ typedef unsigned long ulong;typedef unsigned int uint;typedef unsigned short ushort;typedef unsigned char uchar; #endif #ifndef

2017-10-27 15:56:15 397

reliable rabbitmq c++ client

reliable reconnect rabbitmq-c client. basic get and publish. reconnect when fail

2018-07-16

trade server use evpp test

use callprogram sys to call other system. modify vlogger

2018-07-04

evpp so load system

load so and run. server listen, subprocess connect .

2018-07-02

trade middle ware

trade system. load so and run it. max qps 20000. server listen and send. subprocess connect and recv. should be placed on one machine. linux gcc 4.8

2018-06-29

packet parser

fast k_c_x_p client , fast k_c_b_p parser just for test

2018-06-12

nonblocking server

use murmurhash3 and http status print out delete logs

2018-06-11

nonblocking switch server

fix bugs when packets are too large. improve performance too

2018-06-07

simple exchange platform client

a simple exchange platform client, not used. experimental product

2018-06-01

nonblocking async transfer server

nonblocking using lock_free queue , evpp framework

2018-05-30

event_server

event server with high performance logger ,async write

2018-05-09

evpp based echo server

simple net framework , echo server use qihoo360 open source code evpp

2018-05-03

libevent echo server

libevent example. echo server. use c++11 gcc 4.8.5 thread_pool singleton , io thread , servant thread layer

2018-04-24

lua and acl example

lua call c++, c++ call lua, c++ call lua with lua call c++ so

2018-02-06

thrift with memfunc and uid generator

thrift with uid generator , 28bits wide uuid , 100 year does not be same

2018-01-30

pddl thrift AccessServer

p distributed database framework AccessServer is the wrapper

2018-01-23

thrift server support db operation and rest protocol

modified thrift server , support rest , http protocol with json content . support multi oracle db

2018-01-18

20180111 ieap

use TNonblockingServer framework. getsnap to see which func servant is running

2018-01-11

AnalyzeServer 20180109 with DBConnPool

thrift with DBConnPool using Pro*C ThriftClientPool mem_func logger

2018-01-09

thrift example

thrift server. use client connection pool. singleton conf , async logger and utility classes

2018-01-04

quick fix tester

use quick fix framework to test step protocol. an example for fun

2017-11-21

log file tailer

like linux tail -f command. tail file and format to another line

2017-11-21

exchange processor

middle ware for soft . exchange processer just a queue

2017-11-21

tdx market quotes getter

tdx market quotes caller, test which quote is faster

2017-11-21

Logic business module Tester

lbm caller exapmle use kcbpapi dll just for an test.

2017-11-21

BinaryRecorder

Binary protocol implemented。 just an example. async logger

2017-11-21

prpc_20181112

adding multi server and echo function to prpc framework

2018-11-12

prpc_20181109

using multi event loop in client api. using one channel all client stub share it.

2018-11-09

coroutine using phxrpc

coroutine example, using phxrpc coroutine framework, receive data from upstream and set redis, qps 12w

2018-11-01

transparent proxy

transparent proxy like haproxy. auto testing broken conn tps 300000

2018-09-29

soft like haproxy

hello world program just for test. using evpp for transparent proxy

2018-09-19

prpc rpc framework

modify memory leak bugs. and multithread client press case. 40 w qps

2018-08-28

remote procedure call using protobuffer

protobuffer server remote procedure call framework. using evpp and brpc library

2018-08-21

get class name c++

get class's name. include namespace. use abi damangle

2018-08-08

modp_base64

chrome's base64 encode and decode cpp classes. high performancy

2018-08-08

brpc doubly_buffered_data test

modify brpc library doubly_buffered_data class. test performancy. 100000000 test Get total : 16557607309 ns, avg 165 ns Set total : 21681584661 ns, avg 216 ns

2018-08-07

beanstalkd test client

beanstalkd test client. press test producer and consumer

2018-08-01

snappy library

libsnappy.so C++ library examples. it can work on cmake 2.8.12

2018-07-25

rabbitmq-c client publish get example

rabbitmq exapmles。 declare exchange and queue. the articles in baidu do not help, I have to write examples that can work. basic_publish and basic_tet

2018-07-13

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除