How sustrik/libmill works
Main Components
a. Core Concurrency Components:
• Coroutine Management System (cr.c/h)
• Channel System (chan.c/h)
• Go-style Scheduling (represented by go.c in perf/)
b. I/O Subsystems:
• Network Stack
• TCP Implementation (tcp.c)
• UDP Implementation (udp.c)
• Unix Sockets (unix.c)
• DNS Resolution (dns/dns.c)
• IP Handling (ip.c/h)
• SSL/TLS Support (ssl.c)
c. Event Handling:
• Poller Subsystem (poller.c/h)
• Platform-specific Event Mechanisms
• epoll (Linux) - epoll.inc
• kqueue (BSD/macOS) - kqueue.inc
• poll (Fallback) - poll.inc
d. Support Systems:
• Timer Management (timer.c/h)
• Debug Facilities (debug.c/h)
• Memory Management (stack.c/h)
• Handling (list.c/h, slist.c/h)
┌─────────────────────────────────────────┐
• Application Layer │
• ┘
• ↕
┌─────────────────────────────────────────┐
• Coroutine Management │
• (Scheduling, Channels, Go-style APIs) │
• ┘
• ↕
┌─────────────────────────────────────────┐
• I/O Subsystems │
• (TCP, UDP, Unix Sockets, DNS, SSL) │
• ┘
• ↕
┌─────────────────────────────────────────┐
• Event Handling Layer │
• (Poller, epoll/kqueue/poll) │
• ┘
• ↕
┌─────────────────────────────────────────┐
• Operating System │
• ┘
Important Relationships
• How coroutines interact with channels
• Demonstrate how the scheduling system interfaces with the event polling mechanism
• Relationship between network operations and the event system
• Platform-specific implementations as alternatives in the event handling layer
Implementation Details to Highlight
• How the library integrates with existing C code
• Zero-copy design where applicable
• Demonstrate the relationship between coroutines and system threads
• How the timer system integrates with the event loop