# 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.

Repository: https://github.com/Tencent/libco
Canonical: https://ross.abutalabs.com/products/libco
Language: C++
License: NOASSERTION
License Family: other
Last push: 2024-03-07T09:08:03+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3613, "days_push": 909, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8687, forks 2116 (observed 2026-08-28T04:10:24.237811+00:00)

## What it is
libco is a C/C++ coroutine library widely used in WeChat's back-end services since 2013, running on tens of thousands of machines. It transforms synchronous back-end services into coroutine-based services with minimal code changes, offering socket hooks for transparent asynchronous execution and a copy-stack mode supporting tens of millions of TCP connections.

## Use cases
- convert synchronous backend services to coroutine-based services for higher concurrency
- write asynchronous network code in a synchronous style using socket hooks
- build back-end services supporting tens of millions of TCP connections
- create coroutines with co_create/co_resume/co_yield for fine-grained control
- hook third-party libraries like mysqlclient, ssl, and gethostbyname for async execution
- build lightweight web/CGI services on top of the built-in epoll/kqueue network framework

## When to choose
- you need massive concurrency in C/C++ back-end services without rewriting logic
- you want synchronous-style code that executes asynchronously via socket hooks
- you need proven, production-grade coroutine support at extreme scale
- you want pthread-like coroutine APIs with minimal learning curve

## When to avoid
- you work in a language with native async/await or goroutines
- your project targets Windows or platforms without epoll/kqueue support
- you need a full-featured networking framework rather than a coroutine primitive
- you require a permissive license - the license is not a standard open-source one

## Facets
- artifact type: library
- maturity: stable
- function: concurrency, http-server, networking, middleware
- domain: backend, developer-tools, microservices
- platform: cpp, c
- tags: coroutines, async, socket-hook, epoll, kqueue, copy-stack, wechat, high-concurrency, real-time, linux, macos

## Member repositories
- Tencent/libco (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:24.237811+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:25:35.191740+00:00, confidence not recorded.
  - readme: https://github.com/Tencent/libco (fetched 2026-08-28T04:10:24.237811+00:00, sha 3d4ea5960555)
- Data as of 2026-08-30T08:39:29.467469+00:00.
