基于libmemcached开发php的扩展模块

PHP有个pecl memcached扩展,这是大家默认的选择,对绝大多数应用来说,其实已经够用了,出于学习研究的目的,在朋友小叶的要求下,尝试了利用libmemcached模块来开发一个PHP的扩展。

对于memcached,不在这里多说了,更多的文档可以参照我另外的blog文章或者去memcached官方,在官方文档中,我们可以找到各种语言的APIs,包括已有的pecl memcached API,另外还有Ruby、Perl、C#等API,这次需要用的是C的API,据小叶说,有另外的测试证明基于C API中libmemcached写的Ruby扩展性能比基于libevant写的PHP Pecl Memcached效率高出20倍,这个真实性不去考证了,只准备测试一下用libmemcached来写另外一个PHP的扩展。

这里准备按照最常规的流程来完成这个PHP扩展的开发。目前完整的模块还未写完,只完成了一个测试接口和connect()接口,请有兴趣的朋友随时关注我的更新。

8 thoughts on “基于libmemcached开发php的扩展模块”

  1. Pecl Memcached Extension基于libevant?
    Memcached 基于libevant,Pecl Memcached Extension是自己实现了Memcached的协议解析吧,而没有使用libmemcached,这和libevant似乎没有太大关系,3.0+的Pecl Memcached Extension 加入了新的MemcachePool实现,代码写得挺不错的,不过两者的效率倒还没测试过,期待你的新扩展出现…:)

  2. libmemcached 刚推出来。 ruby 就用它开发了 ruby 的memcache的最新扩展,测试了说性能很好。呵呵我也是看介绍这样说的。Michael 大哥人很好。在这里也要谢谢Michael 对我的帮助。也期待你的libmemcache 新扩展。今天我要搬家。顺便来看看。我顶

  3. [Comment ID #26048 Will Be Quoted Here]

    抱歉,没有来得及更新,asd 朋友告知有了一个已经开发好的,放我一下子丧失了太多热情,又因为最近实在事情太多,把热情和紧急度更高的事情先安排了,空了一定会补齐的。

  4. Michael大哥,请教个问题:

    在编写扩展的时候

    PHP_FUNCTION(test)
    {

    zval *var;
    char *st=””;
    int st_len=0;

    zend_bool i = 0;
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, “z|sb”, &var,&st, &st_len,&i) == FAILURE)
    {
    RETURN_FALSE;
    }

    //我想让程序退出,就好像调用php的 exit()或die()函数; 请问这里该怎么实现呢?
    }

  5. This is very interesting, You are a very skilled blogger.
    I’ve joined your feed and look forward to seeking more of your fantastic post.
    Also, I have shared your website in my social networks!

  6. Hey I am so delighted I found your webpage, I really found you by error, while I was searching on Yahoo for something
    else, Anyhow I am here now and would just like to say thanks a lot for a marvelous post and a all round exciting blog (I also love the theme/design), I don’t have time to read through it all at the moment but I have saved it and also added in your RSS
    feeds, so when I have time I will be back to read
    much more, Please do keep up the superb job.

  7. Heya superb blog! Does running a blog like this require a large amount of work?
    I have very little knowledge of programming but I was hoping to start my own blog
    soon. Anyways, if you have any ideas or tips for new blog owners please
    share. I understand this is off subject however I simply needed
    to ask. Appreciate it!

  8. Pingback: URL
  9. Hi there this is kind of of off topic but I was wondering if blogs use
    WYSIWYG editors or if you have to manually code with HTML.

    I’m starting a blog soon but have no coding expertise so I wanted to get advice from someone
    with experience. Any help would be greatly appreciated!

  10. of course like your website however you have to test the
    spelling on quite a few of your posts. Several of
    them are rife with spelling problems and I in finding
    it very troublesome to inform the truth then again I will surely come again again.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image