自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

我的奋斗

志士嗟日短,愁人知夜长。我则异其趣,一闲对百忙。

  • 博客(34)
  • 收藏
  • 关注

原创 HTTP代理原理探索

Web 上的代理服务器是代表客户端完成事务处理的中间人。如果没有 Web 代理, HTTP 客户端就要直接与 HTTP 服务器进行对话。有了 Web 代理,客户端就可以与代理进行对话,然后由代理代表客户端与服务器进行交流。客户端仍然会完成对事务的处理,但它是通过代理服务器提供的优质服务来实现的。

2017-07-04 19:26:04 1695 2

转载 What exactly is "iowait"?

What exactly is "iowait"?To summarize it in one sentence, 'iowait' is the percentageof time the CPU is idle AND there is at least one I/Oin progress.Each CPU can be in one of four states: user,

2015-04-21 14:21:34 891

转载 Design Principle: Favor Composition Over Inheritance

Here at HauteLook, we’re almost constantly interviewing engineers. Not because we have high turnover, but because we’re always growing the team and it’s difficult to find engineers that have the skill

2015-04-21 09:53:05 944

转载 How I explained Design Patterns to my wife: Part 1

IntroductionMe and my wife had some interesting conversations on Object Oriented Design principles. After publishing the conversation on CodeProject, I got some good responses from the communi

2015-04-20 19:08:47 1380

转载 How I explained OOD to my wife

IntroductionMy wife Farhana wants to resume her career as a software developer (she started her career as a software developer, but couldn't proceed much because of our first child's birth), and

2015-04-20 19:04:37 1240

转载 Exploring System Internals with lsof and strace

This article describes various approaches to looking at the processes in you UNIX environment. Unlike other operating systems, most of the UNIX systems allow you to get a lot of information about the

2015-04-20 11:54:34 1477

转载 A Clarification on Linux Addressing

A Clarification on Linux [email protected], here is my understanding so far (meaning that it is self-contained, no hole being punched yet, but that could change … ).On x86 32-bit architectu

2015-03-30 13:07:55 588

原创 动态链接库的RPATH和RUNPATH解惑

最近在使用SPP网络框架进行业务开发的时候,遭遇动态库搜索路径问题,为了避免其他同学继续在这方面浪费精力,简单整理了相关知识点。【背景知识】这里不打算深入链接器内部,简明扼要给出链接器进行动态库搜索的一些规则。以上是man ld结果部分截图,这里着重澄清两个基本概念:"link time"(链接时)和"runtime"(运行时),比如常用的-L选项属于链接时,而

2015-01-29 20:43:27 8408

原创 基于boost实现的共享内存版HashMap

#include #include #include #include #include int main (int argc, char *argv[]){ typedef int KeyType; typedef float MappedType; typedef std::pair ValueType; typedef boost::interp

2015-01-05 19:36:02 5105 1

原创 PHP协程初体验

PHP协程初体验By warezhou 2014.11.24上次通过C扩展为PHP添加coroutine尝试失败之后,由于短期内啃下Zend可能性几乎为零,只能打语言原生能力的主意了。Google之后发现,PHP5.5引入了Generator和Coroutine新特性,于是才有了本文的诞生。背景阅读《当C/C++后台开发遇上Coroutine》http://

2014-11-24 16:16:43 18585

原创 DockerHub基于Github自动化构建

Docker Hub上的自动化构建关于自动化构建自动化构建是一个特殊的功能,它允许您在 Docker Hub 上使用构建集群,根据指定的 Dockerfile 或者 GitHub 、 BitBucket 仓库(或环境)来自动创建镜像。该系统将从仓库复制一份,并根据以仓库为环境的 Dockerfile 的描述构建镜像。由此产生的镜像将被上传到注册表,并且自动生成标记。自动化构

2014-11-20 14:41:50 14876

原创 一次失败的PHP扩展开发之旅

一次失败的PHP扩展开发之旅

2014-11-19 22:07:44 6874 1

转载 Git使用教程

一:Git是什么?       Git是目前世界上最先进的分布式版本控制系统。二:SVN与Git的最主要的区别?      SVN是集中式版本控制系统,版本库是集中放在中央服务器的,而干活的时候,用的都是自己的电脑,所以首先要从中央服务器哪里得到最新的版本,然后干活,干完后,需要把自己做完的活推送到中央服务器。集中式版本控制系统是必须联网才能工作,如果在局域网还可以,带宽够

2014-10-28 17:23:35 707

转载 Logging Solutions Overview

Contextudp2logCurrently the Wikimedia Foundation uses a custom logging daemon udp2log to transport logs from several different sources to 3 (as of July 2012) dedicated logging machines. Any

2014-10-02 11:22:04 1327

转载 Five things that make Go fast

Anthony Starks has remixed my original Google Present based slides using his fantastic Deck presentation tool. You can check out his remix over on his blog,mindchunk.blogspot.com.au/2014/06/remixing-w

2014-09-28 17:03:41 2162

转载 The Twitter stack

The Twitter stackFor various reasons, including performance and cost, Twitter has poured significant engineering effort into breaking down the site backend into smaller JVM based services. As

2014-09-22 21:27:47 1716

转载 Actor-based Concurrency

The concurrency models we have considered so far have the notion of shared state in common. Shared state can be accessed by multiple threads at the same time and must thus be protected, either by lock

2014-09-17 00:44:48 1934

转载 Is Go An Object Oriented Language?

To truly understand what it means to be ‘object-oriented’ you need to look back at the origination of the concept. The first object oriented language, simula, emerged in the 1960s. It introduced objec

2014-09-15 20:04:58 2140

原创 如何理解“可靠性”和“可用性”?

相信点开这篇文章的读者,一定或多或少接触过“高可靠”“高可用”这些字眼,但是往往或语焉不详,或罗列术语(MTBF、MTTR ...),那么我们到底应该如何定量描述系统的可靠性和可用性指标呢,这些看着很上流的术语到底意味着什么呢?也许,看完这篇文章,您从此也可以和小伙伴们愉快地拽术语了!

2014-08-09 19:04:07 41587 6

转载 STL Support Tools for GDB

STL Support ToolsWhen you try to use GDB's "print" command to display the contents of a vector, a stack, or any other GDB abstract data structure, you will get useless results. Instead, download

2014-08-05 13:01:39 980

转载 Cached VS Buffers

What is the difference between Buffers and Cached columns in /proc/meminfo output?cat /proc/meminfoMemTotal:      8162388 kBMemFree:         86004 kBBuffers:         56432 kBCached

2014-08-05 11:37:18 1763

原创 Raft一致性算法

Paxos算法是莱斯利·兰伯特(LeslieLamport,就是 LaTeX 中的”La”,此人现在在微软研究院)于1990年提出的一种基于消息传递的一致性算法。由于算法难以理解起初并没有引起人们的重视,使Lamport在八年后1998年重新发表到ACM Transactions on Computer Systems上

2014-08-04 20:42:15 76291 12

原创 基于Boost.MultiIndex实现的Session管理器

#ifndef SESSION_MANAGER_#define SESSION_MANAGER_#include #include #include #include #include template class SessionManager{ public: SessionManager(size_t max_size = 10000, uint64_t timeo

2014-08-03 17:53:21 2276

原创 Golang后台开发初体验

犹记得去年靠着微信后台的强势宣传,coroutine在我司的C/C++后台界着实火了一把,当时我也顺势对中心的后台网络框架做了coroutine化改造,详见《当C/C++后台开发遇上Coroutine》,当时在文末我也提到了该实现的一些局限性,包括但不限于:1.       所有的coroutine运行于同一线程空间,无法真正发挥CPU的多核性能2.       非抢占式调度模式,

2014-07-13 16:40:00 41615 4

原创 Unix域协议简介

前言已经不记得什么时候第一次接触Unix Domain Socket(下文简称UDS),在我印象中,所谓UDS基本等同于本地环回接口(lo)上的TCP或者UDP,而事实上UDS所用的API也确实是套接字API。也许正因为这些先入为主的观点,自从进入后台开发这个领域,基本没有正眼瞧过UDS,觉得不过是单机版的TCP/UDP而已。最近shane兄的《OIDB分set实践和技术方案》在K

2014-07-11 21:43:55 4129 2

原创 利用RawSocket篡改UDP源地址

最近在voip项目开发过程中,碰到一种业务场景,接入层通过两种途径对外提供访问入口:CMLB——外部ServerSSO——移动终端由于我们的接入层存在session的概念,因此,一旦session在接入节点X建立后,后续请求都必须由节点X进行处理。但是,无论CMLB还是SSO,都属于无状态负载均衡分发系统,前后请求并无逻辑关联。解决思路:为了提高系统的可扩展

2014-07-07 21:56:58 7357 2

转载 golang 与 duck typing

原文:http://floss.zoomquiet.io/data/20120904000006/index.html什么是 duck typing?在面向对象的编程语言中,当某个地方(比如某个函数的参数)需要符合某个条件的变量(比如要求这个变量实现了某种方法)时,什么是判断这个变量是否“符合条件”的标准?如果某种语言在这种情况下的标准是: 这个变量的类型是否实

2014-06-23 17:26:45 3508 1

原创 Inheritance vs Composition

最近在学习golang的过程中,发现golang抛弃了inheritance,仅支持composition。为了弄清楚两者的优缺点,翻阅了很多材料,发现下面两篇文章写得不错,有兴趣的tx可以读一读:http://www.javaworld.com/article/2076814/core-java/inheritance-versus-composition--which-one-shou

2014-06-23 15:39:20 1848

转载 Web 安全编程实战

Web 安全编程实战Web 安全问题,很多时候会被程序员所忽略,因为他们相信会有专业的运维人员或者安全服务团队帮助他们寻找漏洞,并且指导他们修改这些漏洞。而对于小公司,没有这样专业的人员又怎么办呢?安全漏洞造成了很多不必要的维护和开发任务,产生的问题有时候更是致命的。实际上,只要程序员养成一些习惯,知道一些安全问题的基本原理,可以很大程度避免问题的出现,这也是一个优秀 Web

2014-02-26 23:32:50 1592

原创 “向前兼容”&&“向后兼容”

“向前兼容”——Forward compatibilityA standard supports forward compatibility if older product versions can receive, read, view, play or execute the new standard.“向后兼容”——Backward compatibility

2014-01-26 15:22:14 1029

转载 tcpdump丢包问题解决方法

/****************************************************************************** * Copyright 1998-2008 Davidfan * 2010-0205, Davidfan written * -------------------- ****************************

2014-01-03 20:00:46 8696

原创 C++中的exit&&abort

void exit(int status);Terminate calling processTerminates the process normally, performing the regular cleanup for terminating programs.Normal program termination performs the following (in

2013-12-25 19:50:49 1739

原创 当C/C++后台开发遇上Coroutine

说来有点无厘头,Coroutine最近在公司的C/C++后台开发界,莫名其妙就火起来了,话说这货Melvin Conway在1963年的paper就已经提出来了,半个世纪过去了,咋突然冒出那么多粉丝出来,个人猜测与微信后台近期的Coroutine改造不无关系,也许这就是所谓的技术影响力吧,呵呵!WHY?首先,强烈推荐大家花点时间读一读《State Threads for Inter

2013-11-06 19:51:37 15645

原创 漫谈C++11多线程内存模型

写在前面“C++11 feels like a new language” - Bjarne Stroustrup的确,C++11核心已经发生了巨大的变化,它现在支持Lambda表达式、对象类型自动推断、统一初始化语法、Deleted和Defaulted函数、nullptr、委托构造函数、右值引用等等,本文主要讨论C++11对于多线程编程的支持。一些例子为何C++多线程编程需要对标

2013-09-16 13:54:04 26409 9

空空如也

空空如也

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

TA关注的人

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