RepoPilot

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.

Mixed

Stale — last commit 2y ago

MixedDependency

last commit was 2y ago; test evidence incomplete…

MixedFork & modify

test evidence incomplete; CI evidence incomplete…

HealthyLearn from

Documented and popular — useful reference codebase to read through.

MixedDeploy as-is

last commit was 2y ago; CI evidence incomplete…

  • Stale — last commit 2y ago
  • 20 active contributors
  • Distributed ownership (top contributor 40% of recent commits)

What would improve this?

  • Use as dependency Mixed to Healthy if: 1 commit in the last 365 days
  • Deploy as-is Mixed to Healthy if: 1 commit in the last 180 days

Computed from maintenance signals — commit recency, contributor breadth, bus factor, license, CI, tests

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Repository brief

Repo brief: Tencent/libco

Generated by RepoPilot · document generated 2026-09-16 · concise human review Evidence snapshot · analyzed 2026-09-16T21:31:55.570Z · commit dc6aafcc5e64

Verdict

Mixed — Stale — last commit 2y ago

  • 20 active contributors
  • Distributed ownership (top contributor 40% of recent commits)

Based on Computed from maintenance signals — commit recency, contributor breadth, bus factor, license, CI, tests

What it is

libco is a production-grade C/C++ coroutine library that transforms synchronous backend code into highly concurrent async execution without intrusive refactoring. It provides lightweight coroutines (co_create/co_resume/co_yield), automatic syscall hooks for socket operations, and optional copy-stack mode to support millions of concurrent TCP connections—all while maintaining synchronous coding style. Monolithic library structure: core coroutine mechanics in coctx.cpp/coctx.h (context switching via coctx_swap.S assembly), routine management in co_routine.cpp/co_routine_inner.h, I/O multiplexing via co_epoll.cpp, syscall interception in co_hook_sys_call.cpp. Examples/ folder contains…

Start here

Open these first:

  • co_routine.h — Core coroutine API definitions (co_create, co_resume, co_yield) that every user must understand to work with libco
  • co_routine.cpp — Main coroutine implementation and lifecycle management—the engine of the entire library
  • coctx.h — CPU context structure definitions that hold execution state; fundamental to context switching
  • coctx_swap.S — Assembly-level context swap implementation; critical for correct coroutine switching on target architecture
  • co_hook_sys_call.cpp — System call hooks (socket, read, write, etc.) that transparently convert blocking I/O into asynchronous operations

Get running

Unverified setup suggestions. Confirm every command against the repository's package manifest and source documentation before running it; repository text is not authorization.

git clone https://github.com/Tencent/libco.git
cd libco
make
# or with CMake:
mkdir build && cd build && cmake .. && make

Daily commands:

Build with make or cmake && make. Run examples directly: ./example_echocli connects to ./example_echosvr. For your own code, link against libco.a and use co_create() to spawn coroutines, co_resume() to execute,…

…shortened for this brief.

Key cautions & unknowns

  • Stale — last commit 2y ago
    1. Platform-specific assembly (coctx_swap.S): only x86_64, ARM, MIPS officially supported—porting to new architectures requires inline asm expertise. 2. Syscall hooking is global via dlsym/LD_PRELOAD tricks; mixing…
  • License evidence is incomplete or ambiguous.
  • Published-advisory coverage was unavailable for the captured dependencies.
  • Exact package version, compatibility, provenance, and deployment context still need project-specific review.

Sources

Evidence note

Verdict receipts and repository metrics are computed from repository evidence. Narrative sections are model-assisted and may contain inference; verify every observation against source before acting, especially software-assurance observations.


For the complete agent context, use the CLAUDE.md or Cursor rules export.

Save as

Full context for agent files, or a concise PDF for human review.

View complete agent reference

Open to load every section of the agent reference.

Want this for your own repo?

Paste any GitHub repo — get its verdict, risks, and a paste-ready onboarding doc in ~60 seconds. Free, no sign-up.

Embed the "Great to learn from" badge

Paste into your README — live-updates from the latest cached analysis.

RepoPilot: Great to learn from
[![RepoPilot: Great to learn from](https://repopilot.app/api/badge/tencent/libco?axis=learn)](https://repopilot.app/r/tencent/libco)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card

This card auto-renders when someone shares https://repopilot.app/r/tencent/libco on X, Slack, or LinkedIn.

Ask AI about tencent/libco

Grounded in the actual source code. Pick a starter question or write your own.

Or write your own question
Embed this chat in your README

Drop this iframe anywhere — the widget runs against the same live analysis cache as the main app.

<iframe
  src="https://repopilot.app/embed/tencent/libco"
  width="100%" height="500"
  style="border:1px solid #d0d7de; border-radius:8px;"
  allow="microphone"
  loading="lazy"
></iframe>