自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(24)
  • 收藏
  • 关注

原创 Zookeeper C API 具体应用实例

转载地址:https://www.cnblogs.com/haippy/archive/2013/02/21/2920426.html前面七讲我们基本上介绍完了 Zookeeper C API 的所有内容,本文将结合一个小例子讲讲如何在你的实际项目中使用 Zookeeper 服务。设想如下场景:假设程序 A 需要 7* 24 小时在线对外提供服务,但是 A 程序在生产环境下总是不稳定,时常崩溃,不过幸运的是解决方案很简单,在 A 程序崩溃以后只需要重启它就可以了。当然如此简单的问题你可以提出多种

2020-07-31 22:28:55 409

转载 Zookeeper C API 指南七(Zookeeper 辅助 API 介绍)

转载地址:https://www.cnblogs.com/haippy/archive/2013/02/21/2920426.html在前面的文章中我们讲了大部分 Zookeeper C API,相信大家已经知道怎样使用 Zookeeper C API了吧。我曾在《Zookeeper C API 指南》系列文章的第四篇《Zookeeper C API 指南四(C API 概览)》中也 Zookeeper C API 的分为了 5 类,他们分别是:(1)、初始化、销毁 Zookeeper 句柄,(2)..

2020-07-31 22:27:55 330

转载 Zookeeper C API 指南六(异步 API 介绍)

转载地址:https://www.cnblogs.com/haippy/archive/2013/02/21/2920426.html上一讲《Zookeeper C API 指南五(同步 API 介绍)》讲了Zookeeper 同步 API 的分类和相关解释,相信大家对 Zookeeper 同步 API 也有了一个大致的了解,本文我会给大家介绍 Zookeeper C API 中的异步调用的函数(即以 zoo_a* 开头的函数),本文大致结构与《Zookeeper C API 指南五(同步 API 介绍

2020-07-31 22:26:54 266

转载 Zookeeper C API 指南五(同步 API 介绍)

转载地址:https://www.cnblogs.com/haippy/archive/2013/02/21/2920426.html上一讲《Zookeeper C API 指南四(C API 概览)》讲了Zookeeper C API 的分类和几个基本函数的用法,相信大家对 Zookeeper C API 也有了一个大致的了解,本文我会给大家介绍 Zookeeper C API 中的同步调用的函数(即以 zoo_* 开头的函数)。Zookeeper C API 中与访问 Zookeeper 服务相

2020-07-31 22:25:56 355

转载 Zookeeper C API 指南四(C API 概览)

转载地址:https://www.cnblogs.com/haippy/archive/2013/02/21/2920426.htmlZookeeper C API 概览Zookeeper C API 很规范,接口很容易记忆,大部分接口均以 zoo_ 开头,只有少量接口以 zookeeper_ 开头,所有的 API 汇总如下:void zoo_create_op_init(zoo_op_t * op, const char *path, const char *value,

2020-07-31 22:24:59 294

转载 Zookeeper C API 指南三(回调函数)

转载地址:https://www.cnblogs.com/haippy/archive/2013/02/21/2920261.htmlZookeeper C API 中各种回调函数简介在具体介绍 Zookeeper C API 之前,首先介绍一下 Zookeeper C API 中的各种回调函数的原型:监视函数(watch function)原型typedef void (*watcher_fn)(zhandle_t *zh, int type, int state, const char

2020-07-31 22:23:27 185

转载 Zookeeper C API 指南二(监视(Wathes), 基本常量和结构体介绍)

转载地址:https://www.cnblogs.com/haippy/archive/2013/02/21/2920241.htmlZookeeper 监视(Watches) 简介Zookeeper C API 的声明和描述在 include/zookeeper.h 中可以找到,另外大部分的 Zookeeper C API 常量、结构体声明也在 zookeeper.h 中,如果如果你在使用 C API 是遇到不明白的地方,最好看看 zookeeper.h,或者自己使用 doxygen 生成 Zoo

2020-07-31 22:22:07 205

转载 Zookeeper C API 指南一(准备工作)

发现几篇写的比较好的博客,转载来看看目录Zookeeper C API 指南一(准备工作) Zookeeper C API 指南二(监视(Wathes), 基本常量和结构体介绍) Zookeeper C API 指南三(回调函数) Zookeeper C API 指南四(C API 概览) Zookeeper C API 指南五(同步 API 介绍) Zookeeper C API 指南六(异步 API 介绍) Zookeeper C API 指南七(Zookeeper 辅助 API 介

2020-07-31 22:20:16 179

原创 listenfd ---- accept事件

2020-07-29 20:41:14 516

原创 ZMQ == 服务端创建,接受请求的过程

2020-07-29 20:40:40 356

原创 ZMQ中线程之间发送命令

1. ZMQ中的线程分为两类:一类是socket_base_t 产生的实例,一类是io_thread_t2. 线程间底层通过无锁队列的方式发送命令

2020-07-26 17:15:23 395

原创 zmq -- mailbox -- session之间关系

1.参考资料:ZMQ源码 -- c++版

2020-07-23 22:19:32 452

原创 ZMQ源码阅读 ---- zmq创建线程的过程

1. 整体架构图参考资料:zmq源码-c++版

2020-07-22 23:53:38 318

原创 zmq源码阅读 --- api介绍 -- zmq_ctx_new + zmq_socket + zmq_bind + zmq_close + zmq_ctx_destroy

几个常用的api介绍:参考:ZMQ源码

2020-07-21 23:45:11 447

原创 zmq源码阅读 --- 几个关键的类 -- s_send + s_recv

封装的几个与socket相关的类关于发送与接收的函数来源于:ZMQ源码

2020-07-21 23:26:35 511

原创 zeromq源码阅读 -- msg_t --- 消息的一些封装

msg.hpp/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser

2020-07-21 22:25:39 659

转载 zeromq源码分析笔记之架构

1、zmq概述ZeroMQ是一种基于消息队列的多线程网络库,其对套接字类型、连接处理、帧、甚至路由的底层细节进行抽象,提供跨越多种传输协议的套接字。引用云风的话来说:ZeroMQ 并不是一个对 socket 的封装,不能用它去实现已有的网络协议。它有自己的模式,不同于更底层的点对点通讯模式。它有比 tcp 协议更高一级的协议。(当然 ZeroMQ 不一定基于 TCP 协议,它也可以用于进程间和进程内通讯)它改变了通讯都基于一对一的连接这个假设。ZeroMQ 把通讯的需求看成四类。其中一类是一对一结对通讯

2020-07-21 22:22:48 540

原创 广度搜索 -- 9.2 Word Ladder -- 求具体的路径 -- 图解

/**********************************************************************************************************9.2 Word Ladder II描述Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) fromstart to end, such that:

2020-07-02 22:59:49 222

原创 广度搜索 -- 9.1 Word Ladder -- 求是否有解 -- 图解

/**********************************************************************************************************当题目看不出任何规律,既不能用分治,贪心,也不能用动规时,这时候万能方法——搜就派上用场了。搜索分为广搜和深搜,广搜里面又有普通广搜,双向广搜, A* 搜索等。深搜里面又有普通深搜,回溯法等。广搜和深搜非常类似(除了在扩展节点这部分不一样),二者有相同的框架,如何表示状如何扩展状态?如何判

2020-07-01 23:24:05 243

原创 6.4 First Missing Positive --- 图解

/**********************************************************************************************************Given an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2本质上是桶排序 (buc

2020-07-01 22:48:14 133

原创 排序 --- 6.2 Merge Two Sorted Lists || 6.3 Merge k Sorted Lists --- 图解

/**********************************************************************************************************Merge two sorted linked lists and return it as a new list. e new list should be made by splicingtogether the nodes of the first two lists.*******

2020-07-01 20:28:38 124

原创 排序 -- 6.1 Merge Sorted Array --- 图解

/**********************************************************************************************************Given two sorted integer arrays A and B, merge B into A as one sorted array.Note: You may assume that A has enough space to hold additional elemen.

2020-07-01 20:13:44 136

原创 查找 -- 7.1 Sear for a Range -- 图解

/**********************************************************************************************************描述Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in t

2020-07-01 20:03:30 178

原创 查找 --- Search Insert Position --- 图解

/**********************************************************************************************************7.2 Search Insert Position描述Given a sorted array and a target value, return the index if the target is found. If not, return the indexwhere it wo

2020-07-01 19:48:54 205

空空如也

空空如也

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

TA关注的人

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