update documentation
This commit is contained in:
81
README.md
81
README.md
@@ -2,8 +2,87 @@
|
||||
|
||||
erluv library implementation based on c-node.
|
||||
|
||||
# build
|
||||
## build
|
||||
|
||||
to build the erlang code:
|
||||
|
||||
```sh
|
||||
rebar3 compile
|
||||
```
|
||||
|
||||
to build the C code:
|
||||
|
||||
```sh
|
||||
# on OpenBSD
|
||||
cd c_src
|
||||
alias make="make -f Makefile.openbsd"
|
||||
make
|
||||
```
|
||||
|
||||
## test
|
||||
|
||||
```sh
|
||||
rebar3 eunit
|
||||
rebar3 ct
|
||||
```
|
||||
|
||||
## goal
|
||||
|
||||
- fully implement libuv on erlang
|
||||
|
||||
- create a portable interface
|
||||
|
||||
- create strong abstraction
|
||||
|
||||
- use specific functions/lib based on different systems
|
||||
|
||||
## design
|
||||
|
||||
erluv supports 3 implementations, the default one is with c-node, and
|
||||
permits to create a really strong isolation between different
|
||||
context. The c-node is a slave and will receive the action to execute
|
||||
on the underlying system.
|
||||
|
||||
```txt
|
||||
___________ _________________________
|
||||
| | | |
|
||||
| main node | | different user context |
|
||||
|___________| | ________ __________ |
|
||||
| | | | | | |
|
||||
| erluv_app |<-----| c-node | liberluv | |
|
||||
|___________| | |________|__________| |
|
||||
| | | |
|
||||
| | system | |
|
||||
| |__________| |
|
||||
| _| |_ |
|
||||
| \ / |
|
||||
| ____\ /___ |
|
||||
| | | |
|
||||
| | process | |
|
||||
| |__________| |
|
||||
|_________________________|
|
||||
```
|
||||
|
||||
The two other implementation are using `liberluv` as erlang nif and
|
||||
ports. Those two are not recommanded due to the lack of isolation. In
|
||||
case of nif and ports implementation, you can't use privilege
|
||||
separation even with `sudo` or `doas`.
|
||||
|
||||
## Issues
|
||||
|
||||
* OpenBSD: both erlang package (erlang-19 and erlang-21) present in
|
||||
the ports tree don't export `ei.h` headers.
|
||||
|
||||
* OpenBSD: support on OpenBSD can, at this time, only be made for
|
||||
erlang-19 and erlang-21. Ports erlang-22 and erlang-23 are in
|
||||
progress state.
|
||||
|
||||
* libuv: is not thread safe. That means we need to isolate the
|
||||
communication between the different subprocesses managed by c-node,
|
||||
nif and ports.
|
||||
|
||||
## Resources
|
||||
|
||||
* http://docs.libuv.org/en/v1.x
|
||||
|
||||
* https://erlang.org/doc/apps/erl_interface/ei_users_guide.html
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/* copyright (c) 2020 Mathieu Kerjouan <contact@steepath.eu>
|
||||
*
|
||||
* http://docs.libuv.org/en/v1.x
|
||||
* https://erlang.org/doc/apps/erl_interface/ei_users_guide.html
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
Reference in New Issue
Block a user