Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
enum-class committed Jan 23, 2024
1 parent 8a46450 commit ec335f0
Show file tree
Hide file tree
Showing 348 changed files with 21,448 additions and 4 deletions.
2,658 changes: 2,658 additions & 0 deletions Doxyfile

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Cring

Cring is a lightweight and efficient event loop library written in pure C, designed to simplify asynchronous programming using the io-uring interface. It provides a clean and straightforward API for building scalable network applications.
Cring is a lightweight and efficient event loop library written in pure C, designed to simplify asynchronous programming
using the `io-uring` interface. Leveraging the power of user-level context switching with `ucontext`, It provides a clean and straightforward API for building scalable network applications.
By incorporating ucontext, Cring facilitates the seamless execution of asynchronous tasks, enhancing the overall efficiency of the event-driven paradigm.

Moreover, Cring is designed with a thread-per-core model in mind.
Moreover, Cring is designed with a thread-per-core model in mind, emphasizing optimal resource utilization and parallelism.

## Features

Expand Down Expand Up @@ -51,6 +53,7 @@ Before building Cring, ensure that you have the following prerequisites installe
- Linux 5.6 or newer (support io_uring)
- CMake (version 3.16 or higher)
- A C compiler that supports C11 (e.g., GCC or Clang)
- liburing-dev
## Building Cring
Expand All @@ -75,6 +78,10 @@ Before building Cring, ensure that you have the following prerequisites installe
```bash
cmake --build Release --target clang-tidy-check
```

## Benchmark
## Tests
## Licence

Cring is designed for optimal performance, and we provide a
comprehensive suite of benchmarks to evaluate its efficiency. For
detailed benchmark results and instructions on running specific
tests, please refer to the [Benchmark](benchmark) folder.
288 changes: 288 additions & 0 deletions docs/html/Common_8h.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CRing: lib/Common.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">CRing
</div>
<div id="projectbrief">Cring is a lightweight and efficient event loop library written in pure C utilizing io-uring</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Common.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
<code>#include &lt;stdio.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for Common.h:</div>
<div class="dyncontent">
<div class="center"><img src="Common_8h__incl.png" border="0" usemap="#alib_2Common_8h" alt=""/></div>
<map name="alib_2Common_8h" id="alib_2Common_8h">
<area shape="rect" title=" " alt="" coords="31,5,144,32"/>
<area shape="rect" title=" " alt="" coords="5,80,76,107"/>
<area shape="rect" title=" " alt="" coords="101,80,167,107"/>
</map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="Common_8h__dep__incl.png" border="0" usemap="#alib_2Common_8hdep" alt=""/></div>
<map name="alib_2Common_8hdep" id="alib_2Common_8hdep">
<area shape="rect" title=" " alt="" coords="1053,5,1167,32"/>
<area shape="rect" href="IOContext_8h.html" title=" " alt="" coords="1051,80,1169,107"/>
<area shape="rect" href="Executor_8h.html" title=" " alt="" coords="506,155,615,181"/>
<area shape="rect" href="Executor_8c.html" title=" " alt="" coords="961,237,1072,263"/>
<area shape="rect" href="io-context-integration-test_8c.html" title=" " alt="" coords="666,319,866,360"/>
<area shape="rect" href="io-context-test_8c.html" title=" " alt="" coords="983,326,1149,353"/>
<area shape="rect" href="IOContext_8c.html" title=" " alt="" coords="1199,155,1320,181"/>
<area shape="rect" href="pingpong-client_8c.html" title=" " alt="" coords="381,229,548,271"/>
<area shape="rect" href="pingpong-server_8c.html" title=" " alt="" coords="572,229,739,271"/>
<area shape="rect" href="echo-client_8c.html" title=" " alt="" coords="763,237,937,263"/>
<area shape="rect" href="echo-server_8c.html" title=" " alt="" coords="5,237,183,263"/>
<area shape="rect" href="executor-test_8c.html" title=" " alt="" coords="143,326,298,353"/>
<area shape="rect" href="tests_2utils_8h.html" title=" " alt="" coords="258,237,357,263"/>
<area shape="rect" href="main-test_8c.html" title=" " alt="" coords="323,326,455,353"/>
</map>
</div>
</div>
<p><a href="Common_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:abd0b0523397fb05f0ed46fc217fb630f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Common_8h.html#abd0b0523397fb05f0ed46fc217fb630f">LOG_DEBUG</a>(format, ...)</td></tr>
<tr class="separator:abd0b0523397fb05f0ed46fc217fb630f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abffaf9cecb61026cac6db71a16ace9c5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Common_8h.html#abffaf9cecb61026cac6db71a16ace9c5">LOG_ERROR</a>(format, ...)</td></tr>
<tr class="separator:abffaf9cecb61026cac6db71a16ace9c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6c45889010c1bd68631771b64f18101"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Common_8h.html#ac6c45889010c1bd68631771b64f18101">unlikely</a>(x)&#160;&#160;&#160;__builtin_expect(!!(x), 0)</td></tr>
<tr class="separator:ac6c45889010c1bd68631771b64f18101"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a217a0bd562b98ae8c2ffce44935351e1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Common_8h.html#a217a0bd562b98ae8c2ffce44935351e1">likely</a>(x)&#160;&#160;&#160;__builtin_expect(!!(x), 1)</td></tr>
<tr class="separator:a217a0bd562b98ae8c2ffce44935351e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a22f9ba4d0b088a4f0ae03e1e10c75e78"><td class="memItemLeft" align="right" valign="top">static uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Common_8h.html#a22f9ba4d0b088a4f0ae03e1e10c75e78">align64pow2</a> (uint64_t v)</td></tr>
<tr class="separator:a22f9ba4d0b088a4f0ae03e1e10c75e78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3919466116f3e3201ee4d982cde797c1"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Common_8h.html#a3919466116f3e3201ee4d982cde797c1">align32pow2</a> (uint32_t x)</td></tr>
<tr class="separator:a3919466116f3e3201ee4d982cde797c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a217a0bd562b98ae8c2ffce44935351e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a217a0bd562b98ae8c2ffce44935351e1">&#9670;&nbsp;</a></span>likely</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define likely</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">x</td><td>)</td>
<td>&#160;&#160;&#160;__builtin_expect(!!(x), 1)</td>
</tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="abd0b0523397fb05f0ed46fc217fb630f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abd0b0523397fb05f0ed46fc217fb630f">&#9670;&nbsp;</a></span>LOG_DEBUG</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define LOG_DEBUG</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">format, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>...</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> <span class="keywordflow">do</span> { \</div>
<div class="line"> fprintf(stdout, <span class="stringliteral">&quot;[DEBUG %s] &quot;</span> format, __func__, ##__VA_ARGS__); \</div>
<div class="line"> } <span class="keywordflow">while</span> (0)</div>
</div><!-- fragment -->
</div>
</div>
<a id="abffaf9cecb61026cac6db71a16ace9c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abffaf9cecb61026cac6db71a16ace9c5">&#9670;&nbsp;</a></span>LOG_ERROR</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define LOG_ERROR</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">format, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>...</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> <span class="keywordflow">do</span> { \</div>
<div class="line"> (void)fprintf(stderr, <span class="stringliteral">&quot;[ERROR %s] &quot;</span> format, __func__, ##__VA_ARGS__); \</div>
<div class="line"> } <span class="keywordflow">while</span> (0)</div>
</div><!-- fragment -->
</div>
</div>
<a id="ac6c45889010c1bd68631771b64f18101"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac6c45889010c1bd68631771b64f18101">&#9670;&nbsp;</a></span>unlikely</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define unlikely</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">x</td><td>)</td>
<td>&#160;&#160;&#160;__builtin_expect(!!(x), 0)</td>
</tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a3919466116f3e3201ee4d982cde797c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3919466116f3e3201ee4d982cde797c1">&#9670;&nbsp;</a></span>align32pow2()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static uint32_t align32pow2 </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>x</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a22f9ba4d0b088a4f0ae03e1e10c75e78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22f9ba4d0b088a4f0ae03e1e10c75e78">&#9670;&nbsp;</a></span>align64pow2()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static uint64_t align64pow2 </td>
<td>(</td>
<td class="paramtype">uint64_t&#160;</td>
<td class="paramname"><em>v</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
16 changes: 16 additions & 0 deletions docs/html/Common_8h__dep__incl.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<map id="lib/Common.h" name="lib/Common.h">
<area shape="rect" id="node1" title=" " alt="" coords="1053,5,1167,32"/>
<area shape="rect" id="node2" href="$IOContext_8h.html" title=" " alt="" coords="1051,80,1169,107"/>
<area shape="rect" id="node3" href="$Executor_8h.html" title=" " alt="" coords="506,155,615,181"/>
<area shape="rect" id="node8" href="$Executor_8c.html" title=" " alt="" coords="961,237,1072,263"/>
<area shape="rect" id="node11" href="$io-context-integration-test_8c.html" title=" " alt="" coords="666,319,866,360"/>
<area shape="rect" id="node12" href="$io-context-test_8c.html" title=" " alt="" coords="983,326,1149,353"/>
<area shape="rect" id="node14" href="$IOContext_8c.html" title=" " alt="" coords="1199,155,1320,181"/>
<area shape="rect" id="node4" href="$pingpong-client_8c.html" title=" " alt="" coords="381,229,548,271"/>
<area shape="rect" id="node5" href="$pingpong-server_8c.html" title=" " alt="" coords="572,229,739,271"/>
<area shape="rect" id="node6" href="$echo-client_8c.html" title=" " alt="" coords="763,237,937,263"/>
<area shape="rect" id="node7" href="$echo-server_8c.html" title=" " alt="" coords="5,237,183,263"/>
<area shape="rect" id="node9" href="$executor-test_8c.html" title=" " alt="" coords="143,326,298,353"/>
<area shape="rect" id="node10" href="$tests_2utils_8h.html" title=" " alt="" coords="258,237,357,263"/>
<area shape="rect" id="node13" href="$main-test_8c.html" title=" " alt="" coords="323,326,455,353"/>
</map>
1 change: 1 addition & 0 deletions docs/html/Common_8h__dep__incl.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5f9c875e253b9f26fbb5c60e8e1273cf
Binary file added docs/html/Common_8h__dep__incl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/html/Common_8h__incl.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<map id="lib/Common.h" name="lib/Common.h">
<area shape="rect" id="node1" title=" " alt="" coords="31,5,144,32"/>
<area shape="rect" id="node2" title=" " alt="" coords="5,80,76,107"/>
<area shape="rect" id="node3" title=" " alt="" coords="101,80,167,107"/>
</map>
1 change: 1 addition & 0 deletions docs/html/Common_8h__incl.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
72396f870d15af4beec0ce895faa771f
Binary file added docs/html/Common_8h__incl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ec335f0

Please sign in to comment.