Skip to content

Latest commit

 

History

History
7 lines (4 loc) · 921 Bytes

arch.md

File metadata and controls

7 lines (4 loc) · 921 Bytes

To build network servers in MirageOS, you need to understand three concepts:

  • Concurrency is handled using co-operative threads, which means that your application must explicitly yield control to other threads. These threads are very light-weight, and thus this model works well for parallel I/O.

  • Networking traffic is fed to the application via lens buffers, which are data structures designed for zero-copy parsing and construction of wire traffic. MirageOS provides several methods to make it easy to parse binary protocols (e.g. Ethernet, TCP/IP or BGP), text protocols (e.g. ABNF grammers for HTTP or IMAP), and data formats like XML or JSON.

  • Storage is provided via an ORM extension which lets native OCaml types be saved and queried. Some backends are relational (SQLite) and others purely functional with permanent history (e.g. the git or block-based backends).