sustrik/libdill logo

sustrik/libdill

Free

Structured concurrency in C

FreeFree tier
Type
Open Source

About sustrik/libdill

libdill is a C library providing structured concurrency through coroutines and channels, designed to build efficient, concurrent network applications. It implements a wide range of network protocols including TCP, UDP, TLS, HTTP, WebSockets, SOCKS5, and IPC, all within a lightweight coroutine framework that prevents common concurrency bugs like resource leaks and deadlocks. The library is MIT-licensed, portable across Unix-like systems, and comes with tutorials, examples, and reference documentation at libdill.org.

Key Features

Coroutines for concurrent programming
Channels for communication between coroutines
Support for TCP, UDP, TLS, HTTP, WebSockets, SOCKS5, and IPC protocols
Lightweight and efficient design
Structured concurrency model to avoid resource leaks and deadlocks
MIT licensed for commercial and open source use
Portable across Unix-like systems (Linux, macOS, etc.)
Comprehensive documentation, tutorials, and examples

Pros & Cons

Pros
  • Follows structured concurrency principles, reducing common concurrency bugs
  • Lightweight coroutines with low overhead compared to threads
  • Wide range of built-in network protocols reduces external dependencies
  • MIT license allows use in commercial projects
  • Active development and community with 1.9k GitHub stars
Cons
  • Limited to the C language, not applicable to higher-level languages
  • Requires manual memory management typical of C programming
  • Less widely adopted compared to concurrency libraries like libuv or libevent
  • Documentation could be more exhaustive for advanced use cases

Best For

Building high-performance concurrent network serversImplementing custom network protocolsEducational purposes for learning structured concurrencyEmbedded systems programming with CCreating lightweight microservices or daemons