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()接口,请有兴趣的朋友随时关注我的更新。
Pecl Memcached Extension基于libevant?
Memcached 基于libevant,Pecl Memcached Extension是自己实现了Memcached的协议解析吧,而没有使用libmemcached,这和libevant似乎没有太大关系,3.0+的Pecl Memcached Extension 加入了新的MemcachePool实现,代码写得挺不错的,不过两者的效率倒还没测试过,期待你的新扩展出现…:)
刚才简单看了一下pecl memcached扩展的代码(http://cvs.php.net/viewvc.cgi/pecl/memcache/memcache.c?content-type=text%2Fplain&view=co),的确如楼上朋友所说,倒是了解到memcached是用到libevent的,具体的从这里可以看到:http://cvs.php.net/viewvc.cgi/pecl/memcache/README?revision=1.3.2.1&view=markup
libmemcached 刚推出来。 ruby 就用它开发了 ruby 的memcache的最新扩展,测试了说性能很好。呵呵我也是看介绍这样说的。Michael 大哥人很好。在这里也要谢谢Michael 对我的帮助。也期待你的libmemcache 新扩展。今天我要搬家。顺便来看看。我顶
为什么类似的文章老是没有下文呢 。。汗。。。
[Comment ID #26048 Will Be Quoted Here]
抱歉,没有来得及更新,asd 朋友告知有了一个已经开发好的,放我一下子丧失了太多热情,又因为最近实在事情太多,把热情和紧急度更高的事情先安排了,空了一定会补齐的。
呵呵。我是asd 。老大忙。肯定没那么快更新拉。你以为老大专业出教程的呀? 老大不用急。哈哈
[Comment ID #26053 Will Be Quoted Here]
本来是帮asd顺手给弄出来的,结果没想后来因工作耽误了,ads兄弟确跑到我前面去了,对不住大家了,朋友们可以去asd的站上看他刚写出来的完整的扩展代码,地址在这里: http://www.laoniphp.com/
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()函数; 请问这里该怎么实现呢?
}
Hi there to all, since I am actually keen of reading this web site’s post to be updated on a
regular basis. It contains pleasant data.
This design is incredible! You definitely know how to keep a reader amused.
Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Great job.
I really loved what you had to say, and more than that,
how you presented it. Too cool!
Hi there, yup this post is genuinely pleasant and I
have learned lot of things from it on the topic of blogging.
thanks.
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!
Great delivery. Sound arguments. Keep up the great effort.
Hey there would you mind letting me know which web host you’re working with?
I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot faster then most.
Can you recommend a good hosting provider at a honest price?
Thanks a lot, I appreciate it!
What’s up, after reading this amazing paragraph i am as well
delighted to share my familiarity here with colleagues.
Hello There. I discovered your blog using msn. That is a really smartly written article.
I’ll make sure to bookmark it and come back to read more of your useful information. Thank you for the post.
I’ll certainly return.
Hi there, I enjoy reading all of your article post. I wanted to write a
little comment to support you.
Hello, always i used to check weblog posts here early in the morning,
because i love to gain knowledge of more and more.
certainly like your web-site however you have to test the spelling on quite a few of your posts.
A number of them are rife with spelling issues and I find it very bothersome to tell the truth then again I’ll certainly come
back again.
you’re in reality a excellent webmaster. The web site loading pace
is incredible. It seems that you are doing any distinctive trick.
Moreover, The contents are masterpiece. you have performed a magnificent process in this topic!
wonderful post, very informative. I wonder why the opposite experts of this sector do not realize this.
You must continue your writing. I am confident, you have a huge readers’ base already!
I read this piece of writing completely regarding the comparison of most up-to-date and preceding technologies, it’s remarkable
article.
What’s up friends, how is everything, and what you would like to say regarding this piece of writing, in my view
its in fact amazing for me.
Hello, I want to subscribe for this weblog to get newest updates,
therefore where can i do it please help out.
It’s very simple to find out any matter on web as compared to books,
as I found this article at this web site.
I constantly spent my half an hour to read this blog’s content every day along with
a cup of coffee.
Yes! Finally someone writes about plenty of fish dating site.
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.
You made your position quite effectively!!
canadian drugs
canadian pharmacy online canada – https://www.canadianonlinepharmacytrust.com/
price prescription drugs ka 2241cf4
Hi! I’m at work surfing around your blog from my new apple iphone!
Just wanted to say I love reading through
your blog and look forward to all your posts! Keep up the
outstanding work!
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!
You really make it appear so easy along with your presentation but I find this topic to be really one
thing that I feel I’d never understand. It seems too complex and very wide for
me. I am taking a look ahead to your subsequent put up,
I will attempt to get the hold of it!
Hello! I simply want to offer you a huge thumbs up for the great info you have got here on this post.
I am coming back to your web site for more soon.
I’m very happy to uncover this great site. I want to to thank you for your time for this wonderful read!!
I definitely enjoyed every part of it and i also have
you bookmarked to look at new stuff on your web site.
Does your site have a contact page? I’m having problems locating it but, I’d like to send you an e-mail.
I’ve got some suggestions for your blog you might be interested in hearing.
Either way, great website and I look forward to seeing it develop over time.
Thanks for one’s marvelous posting! I genuinely enjoyed reading it, you could be a great author.I will be sure to
bookmark your blog and definitely will come back in the future.
I want to encourage you to continue your great writing, have a nice afternoon!
I blog quite often and I genuinely appreciate your information. This great article has truly peaked my interest.
I am going to bookmark your site and keep checking for new details about once per
week. I subscribed to your Feed too.
This is very fascinating, You’re an overly skilled blogger.
I’ve joined your rss feed and look ahead to in the hunt for extra of your excellent post.
Additionally, I have shared your web site in my social networks
An impressive share! I’ve just forwarded this onto a co-worker who was conducting a little research on this.
And he in fact ordered me breakfast due to the fact that
I stumbled upon it for him… lol. So allow me to reword this….
Thank YOU for the meal!! But yeah, thanx for spending the time to
discuss this subject here on your web page.
Hi, I do think this is an excellent blog. I stumbledupon it 😉 I will return yet again since i have saved as a favorite it.
Money and freedom is the greatest way to change, may you be rich and
continue to guide other people.
Howdy, i read your blog occasionally and i own a similar one and i was just curious if you get a
lot of spam responses? If so how do you reduce it, any plugin or anything
you can suggest? I get so much lately it’s driving me crazy so any support is very much appreciated.
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!
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.
I visit daily a few blogs and blogs to read articles, however this web
site presents quality based articles.
Do you have a spam problem on this website; I also am a blogger,
and I was curious about your situation; many of us have created some
nice practices and we are looking to trade strategies
with other folks, please shoot me an e-mail if interested.
Way cool! Some very valid points! I appreciate you writing this article and
also the rest of the site is also really good.
It is truly a great and helpful piece of info. I am glad that you shared this
helpful information with us. Please keep us informed like this.
Thank you for sharing.