<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[cometeor的专栏]]></title><description><![CDATA[语言的意义即用法]]></description><link>https://blog.csdn.net/cometeor</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; cometeor]]></copyright><item><title><![CDATA[用C#中的yield实现Coroutine框架]]></title><link>https://blog.csdn.net/cometeor/article/details/6319755</link><guid>https://blog.csdn.net/cometeor/article/details/6319755</guid><author>cometeor</author><pubDate>Wed, 13 Apr 2011 10:23:00 +0800</pubDate><description><![CDATA[最近看到Unity3D中的Coroutine，思路相当值得借鉴。在服务器（尤其是基于事件驱动框架的服务器）编程中，异步操作是难以避免的。传统的异步操作会因为大量的回调操作造成逻辑的支离破碎，再加上状态维护和各种异常处理，很容易就将代码的复杂度提升到外星人才能理解的程度。比如，有这样一个宠物AI：等待主人下达移动命令；移动到目标地点；等待3秒钟；喊话；常用的编程模式（非轮询）：class Pet
{
    public event MoveCompleted;
    public Dispatche]]></description><category></category></item><item><title><![CDATA[Protobuf生态圈（上）简介和数据库粘合层]]></title><link>https://blog.csdn.net/cometeor/article/details/6170622</link><guid>https://blog.csdn.net/cometeor/article/details/6170622</guid><author>cometeor</author><pubDate>Mon, 31 Jan 2011 10:27:00 +0800</pubDate><description><![CDATA[关于Protobufprotobuf是google的一个开源序列化框架，基于二进制数据交换格式，兼顾了效率和灵活性。详见http://code.google.com/p/protobuf/。本文假定读者对protobuf已经有了初步接触，故略过一些基本和细节的描述，着重于介绍protobuf在笔者项目中的应用思路。因项目主要编程语言是c++，所以本文的示例着眼于如何在c++中借助protobuf简化一些通用模块的处理。对于其它语言（java，python等），如果语言本身没有更好用的特性或者更方便的库的话，]]></description><category></category></item><item><title><![CDATA[整合OGRE和bullet的地形]]></title><link>https://blog.csdn.net/cometeor/article/details/5670216</link><guid>https://blog.csdn.net/cometeor/article/details/5670216</guid><author>cometeor</author><pubDate>Mon, 14 Jun 2010 01:05:00 +0800</pubDate><description><![CDATA[<br />把OGRE和bullet的地形整合在一起比预想中的麻烦。<br />主要是两个问题：通过HeightField生成三角形网格的方式不一样，以及HeightFiled寻址方式不同（OGRE转换成float数组后，以坐下角为(0,0)点，而bullet的btHeightfieldTerrainShape类是左上角）。好在需要改动的地方在btHeightfieldTerrainShape都是虚函数，所以可以通过继承来解决（看来作者已经预料到这些问题，不过注释很少，很多东西需要看源码才能弄清楚）。以下是]]></description><category></category></item><item><title><![CDATA[整合OGRE的地形和PSSM+LiSPSM阴影算法]]></title><link>https://blog.csdn.net/cometeor/article/details/5657168</link><guid>https://blog.csdn.net/cometeor/article/details/5657168</guid><author>cometeor</author><pubDate>Wed, 09 Jun 2010 01:08:00 +0800</pubDate><description><![CDATA[<br />OGRE版本1.7.1的Sample里包含了地形的示例，且用到了PSSM+LiSPSM。<br />今天尝试把Character的Sinbad模型摆到地形上，不过模型的材质本身不支持PSSM。<br />看了下地形示例的实现，发现它在给Shader传PSSM分界点数据时，用了把模板材质clone一份，再设置diffusemap和pssm分界点的方法，相当让人无语....<br />		MaterialPtr ret = MaterialManager::getSingleton().getByN]]></description><category></category></item><item><title><![CDATA[关于iostreams的效率]]></title><link>https://blog.csdn.net/cometeor/article/details/5614810</link><guid>https://blog.csdn.net/cometeor/article/details/5614810</guid><author>cometeor</author><pubDate>Fri, 21 May 2010 17:41:00 +0800</pubDate><description><![CDATA[    简单测试发现iostreams::stream的效率比我想象中要低...看了一下源码，发现写入流的数据并不是直接写入到device中，而是在内部缓存起来，缓冲区满或者调用flush时才把数据复制到device里，造成不必要的内存拷贝。缓冲的机制对于比较慢的device（如标准io、文件流等）是常用的策略，不过对于我的应用来说（相当于把流输出到vector中）就是不必要的步骤了。仔细阅读手册]]></description><category></category></item><item><title><![CDATA[protobuf消息的自动派发]]></title><link>https://blog.csdn.net/cometeor/article/details/5611854</link><guid>https://blog.csdn.net/cometeor/article/details/5611854</guid><author>cometeor</author><pubDate>Thu, 20 May 2010 17:19:00 +0800</pubDate><description><![CDATA[google protobuf消息序列化后的数据是没有类型信息的。而一般网络应用要求序列化后发送到对端，还原出类型，反序列化，再派发给相应的消息处理函数。以下代码简单实现了自动派发的机制。新增protobuf消息只要增加一行声明的代码和相应的处理函数就可以了。http://eddyserver.googlecode.com/svn/trunk/common/tests/protoserve]]></description><category></category></item><item><title><![CDATA[整合protobuf、boost::iostreams和NetMessage类]]></title><link>https://blog.csdn.net/cometeor/article/details/5611771</link><guid>https://blog.csdn.net/cometeor/article/details/5611771</guid><author>cometeor</author><pubDate>Thu, 20 May 2010 16:56:00 +0800</pubDate><description><![CDATA[示例代码见http://eddyserver.googlecode.com/svn/trunk/common/tests/messagetest.cc NetMessage类提供了兼容stl的接口，通过boost::iostreams示例的ContainerDevice可以方便的与boost::iostreams::stream结合起来。而boost::iostreams::str]]></description><category></category></item><item><title><![CDATA[asio socket::close时异步操作的处理]]></title><link>https://blog.csdn.net/cometeor/article/details/5605139</link><guid>https://blog.csdn.net/cometeor/article/details/5605139</guid><author>cometeor</author><pubDate>Tue, 18 May 2010 19:09:00 +0800</pubDate><description><![CDATA[asio中socket通常的用法如class Session { public:  void HandleRead(const boost::system::error_code& error,                         size_t bytes_transferred) {    if (error) {      delete this;   ]]></description><category></category></item><item><title><![CDATA[boost::bind效率上的注意事项]]></title><link>https://blog.csdn.net/cometeor/article/details/5594994</link><guid>https://blog.csdn.net/cometeor/article/details/5594994</guid><author>cometeor</author><pubDate>Sat, 15 May 2010 13:39:00 +0800</pubDate><description><![CDATA[今天粗略测试了一下boost::bind的性能，得出以下几个猜测(仅限于gcc，windows下未测试)：boost::function内部预留了(sizeof(成员函数指针) + sizeof(指针))的空间，所以如果bind的参数占用空间小，则会使用placement new的方式，不会涉及动态内存分配。典型的情况如boost::bind(成员函数指针, 对象指针)，或者全局函数指针加少量]]></description><category></category></item><item><title><![CDATA[代码已上传至googlecode]]></title><link>https://blog.csdn.net/cometeor/article/details/5593606</link><guid>https://blog.csdn.net/cometeor/article/details/5593606</guid><author>cometeor</author><pubDate>Fri, 14 May 2010 22:13:00 +0800</pubDate><description><![CDATA[本blog的相关代码svn checkout http://eddyserver.googlecode.com/svn/trunk/ eddyserver-read-only未完善，烂是烂了点...]]></description><category></category></item><item><title><![CDATA[boost::asio 1.4.3的linux实现总算采用epoll的et模式了]]></title><link>https://blog.csdn.net/cometeor/article/details/5593600</link><guid>https://blog.csdn.net/cometeor/article/details/5593600</guid><author>cometeor</author><pubDate>Fri, 14 May 2010 22:08:00 +0800</pubDate><description><![CDATA[Asio:Improved performance.Reduced compile times.Reduced the size of generated code.Extended the guarantee that background threads dont call user code to all asynchronous operations (#3923).]]></description><category></category></item><item><title><![CDATA[高效的网络消息类实现]]></title><link>https://blog.csdn.net/cometeor/article/details/5593514</link><guid>https://blog.csdn.net/cometeor/article/details/5593514</guid><author>cometeor</author><pubDate>Fri, 14 May 2010 21:40:00 +0800</pubDate><description><![CDATA[感谢gogoplayer提供的思路。 事情的经过是这样的：几天前gogoplayer跟我提到想用引用计数来解决消息广播时拷贝多份的问题，顺带提到boost::shared_ptr的引用计数是线程安全的。这一点跟我的记忆有出入，于是查boost的手册确认了一下，发现从1.33.0开始shared_ptr就用了lock-free来实现线程安全，相当高效。 于是就想把原本的NetMess]]></description><category></category></item><item><title><![CDATA[TCMalloc]]></title><link>https://blog.csdn.net/cometeor/article/details/5012033</link><guid>https://blog.csdn.net/cometeor/article/details/5012033</guid><author>cometeor</author><pubDate>Tue, 15 Dec 2009 15:46:00 +0800</pubDate><description><![CDATA[今天看protobuf的文档提到了TCMalloc，发现其小对象的内存分配策略跟我在项目中的实现思路差不多...不过它的大对象另有一套策略，而且远比我写的通用。要是早知道这玩意就不用重复发明轮子了。相关文档：http://goog-perftools.sourceforge.net/doc/tcmalloc.html中文翻译：http://shiningray.cn/tcmalloc-]]></description><category></category></item><item><title><![CDATA[快速构建MMO服务器框架（七）高并发TCP网络框架]]></title><link>https://blog.csdn.net/cometeor/article/details/5005644</link><guid>https://blog.csdn.net/cometeor/article/details/5005644</guid><author>cometeor</author><pubDate>Mon, 14 Dec 2009 18:09:00 +0800</pubDate><description><![CDATA[忙活了一个多星期，差不多把基于TCP的高并发连接网络架构测试稳定了。目的：利用多线程把网络连接及数据包压缩/解压、加密/解密等等耗时的操作分流（asio对这些没有原生的支持），顺带提供线程池框架。只对游戏逻辑层暴露出单线程的外观，隔离底层多线程的复杂度。结构如下图（未遵循什么标准，将就着看吧）： TCPSessionHandler：暴露给逻辑层的类，内部负责通过TCPIOT]]></description><category></category></item><item><title><![CDATA[菊花驱动开发]]></title><link>https://blog.csdn.net/cometeor/article/details/5003059</link><guid>https://blog.csdn.net/cometeor/article/details/5003059</guid><author>cometeor</author><pubDate>Mon, 14 Dec 2009 11:36:00 +0800</pubDate><description><![CDATA[在http://www.scottberkun.com看到的另一篇，蛮有意思。(话说这个网站用的图标是其作者名的简写S*B...)   Asshole driven developmentThe software industry might be the world’s greatest breeding ground for new systems of managemen]]></description><category></category></item><item><title><![CDATA[无为]]></title><link>https://blog.csdn.net/cometeor/article/details/5002764</link><guid>https://blog.csdn.net/cometeor/article/details/5002764</guid><author>cometeor</author><pubDate>Mon, 14 Dec 2009 10:58:00 +0800</pubDate><description><![CDATA[今天在某qq群里看到有人群发了这样一段话：  A healthy, confident, well-adjusted manager knows their job is to do three things:  1. Hire thoroughbreds, point them at the finish line, and get out of their way unle]]></description><category></category></item><item><title><![CDATA[快速构建MMO服务器框架（六）asio稍微复杂一些的例子：高并发echo]]></title><link>https://blog.csdn.net/cometeor/article/details/4901332</link><guid>https://blog.csdn.net/cometeor/article/details/4901332</guid><author>cometeor</author><pubDate>Sun, 29 Nov 2009 19:55:00 +0800</pubDate><description><![CDATA[ 以下是来自boost example的异步echo server：//// async_tcp_echo_server.cpp// ~~~~~~~~~~~~~~~~~~~~~~~~~//// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)//// Distribut]]></description><category></category></item><item><title><![CDATA[快速构建MMO服务器框架（五）timer的那些事儿]]></title><link>https://blog.csdn.net/cometeor/article/details/4897312</link><guid>https://blog.csdn.net/cometeor/article/details/4897312</guid><author>cometeor</author><pubDate>Sat, 28 Nov 2009 22:26:00 +0800</pubDate><description><![CDATA[     定时器管理在MMO服务器这类需要处理大量事务的系统中，往往是优化的热点。    最简单的轮询式定时器的实现如（psudo code）：class Player{	public:		void loop()		{			if (timer.check())			{				//do something;			}			//other timer ...]]></description><category></category></item><item><title><![CDATA[快速构建MMO服务器框架（四）关于boost.asio的补充]]></title><link>https://blog.csdn.net/cometeor/article/details/4895814</link><guid>https://blog.csdn.net/cometeor/article/details/4895814</guid><author>cometeor</author><pubDate>Sat, 28 Nov 2009 16:24:00 +0800</pubDate><description><![CDATA[ 今天看了看asio的源码，上一篇的一些疑惑也清楚了。遇到问题果然read the f**king code才是王道。 关于异步socket：io_service在调用async_send、async_receive这类接口的时候，会把socket设置成非阻塞，用户不需要手动设置（相当体贴）。不过类似no_delay这样策略性的选项还是需要操心的（不然谁知道你想干嘛）。 关于lin]]></description><category></category></item><item><title><![CDATA[不小心卸载了python2.6，后果很严重....]]></title><link>https://blog.csdn.net/cometeor/article/details/4895375</link><guid>https://blog.csdn.net/cometeor/article/details/4895375</guid><author>cometeor</author><pubDate>Sat, 28 Nov 2009 15:04:00 +0800</pubDate><description><![CDATA[ 今天由于boost编译要依赖python的开发包，安装python3.1之后觉得可以把2.6卸载了于是 sudo apt-get remove python2.6 回车 看也不看按y.....一大堆依赖python的软件也跟着卸载了....后果：重装ubuntu]]></description><category></category></item></channel></rss>