(Translated by https://www.hiragana.jp/)
GitHub - Tencent/libco: libco is a coroutine library which is widely used in wechat back-end service. It has been running on tens of thousands of machines since 2013.
Skip to content
/ libco Public

libco is a coroutine library which is widely used in wechat back-end service. It has been running on tens of thousands of machines since 2013.

License

Notifications You must be signed in to change notification settings

Tencent/libco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libco

Libco is a c/c++ coroutine library that is widely used in WeChat services. It has been running on tens of thousands of machines since 2013.

By linking with libco, you can easily transform synchronous back-end service into coroutine service. The coroutine service will provide out-standing concurrency compare to multi-thread approach. With the system hook, You can easily coding in synchronous way but asynchronous executed.

You can also use co_create/co_resume/co_yield interfaces to create asynchronous back-end service. These interface will give you more control of coroutines.

By libco copy-stack mode, you can easily build a back-end service support tens of millions of tcp connection.


简介

libcoほろしんきさきだいだい规模使用しようてきc/c++协程库,2013ねんいたりこん稳定运行ざいほろしんきさきだいてきすうまんだいつくえじょう

libcoどおり过仅ゆうてき几个函数かんすうせっこう co_create/co_resume/co_yield さい配合はいごう co_poll,支持しじどうあるもの异步てきうつしほう,如线ほど库一样轻まつどう时库さとめん提供ていきょうりょうsocketぞく函数かんすうてきhook,使つかいとくきさきだい逻辑ふく务几乎不ようおさむあらため逻辑だい码就完成かんせい异步改造かいぞう

作者さくしゃ: sunnyxu(sunnyxu@tencent.com), leiffyli(leiffyli@tencent.com), dengoswei@gmail.com(dengoswei@tencent.com), sarlmolchen(sarlmolchen@tencent.com)

PS: ちかはた开源PaxosStore,けい期待きたい

libcoてき特性とくせい

  • 无需侵入しんにゅう业务逻辑,进程、线程ふく务改造成ぞうせい协程ふく务,并发能力のうりょくいたひゃくばいひさげます;
  • 支持しじCGIかまち,轻松构建webふく务(New);
  • 支持しじgethostbyname、mysqlclient、sslとう常用じょうようだいさん库(New);
  • 选的どもとおる栈模しき,单机轻松せっいれせんまん连接(New);
  • かんぜん简洁てき协程编程せっこう
  • 类pthreadせっこう设计,つう过co_create、co_resumeとう简单きよし晰接こうそく完成かんせい协程てき创建あずか恢复;
  • __threadてき协程私有しゆう变量、协程间通信つうしんてき协程信号しんごうりょうco_signal (New);
  • 语言级别てきlambda实现,结合协程原ほどはら编写并执ぎょうきさきだい异步にん务 (New);
  • もと于epoll/kqueue实现てきしょう而轻てき网络かまち于时间轮盘实现的高性能こうせいのうてい时器;

Build

$ cd /path/to/libco
$ make

or use cmake

$ cd /path/to/libco
$ mkdir build
$ cd build
$ cmake ..
$ make

About

libco is a coroutine library which is widely used in wechat back-end service. It has been running on tens of thousands of machines since 2013.

Resources

License

Stars

Watchers

Forks

Packages

No packages published