Skip to content

Commit

Permalink
Doc add photon-architecture.md
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 committed Sep 28, 2023
1 parent 9d5f5cb commit 87dfc84
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion doc/docs/introduction/how-to-build.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 2
sidebar_position: 3
toc_max_heading_level: 4
---

Expand Down
2 changes: 1 addition & 1 deletion doc/docs/introduction/how-to-integrate.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 3
sidebar_position: 4
toc_max_heading_level: 4
---

Expand Down
20 changes: 20 additions & 0 deletions doc/docs/introduction/photon-architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
sidebar_position: 2
toc_max_heading_level: 4
---

# Photon Architecture

The major goal of Photon is to handle concurrency and I/O (including file I/O and networking I/O).

![architecture](/img/photon.png)

Its components are:

* [Thread](../api/thread.md), [vCPU](../api/vcpu-and-multicore.md), timer, sync primitives, gdb extension, emulation of std::thread, task dispatching ...
* Multiple IO wrappers: psync, posix_aio, libaio, io_uring
* Multiple socket implementations: tcp (level-trigger/edge-trigger), unix-domain, zero-copy, libcurl, TLS support, etc.
* High performance RPC client/server, HTTP client/server.
* A POSIX-like filesystem abstraction and some implementations: local fs, http fs, fuse fs, e2fs, etc.
* Common utilities: io-vector manipulation, resource pool, object cache, mem allocator, callback delegator,
pre-compiled logging, lockless ring buffer, defer, range lock, throttle, etc.
13 changes: 2 additions & 11 deletions doc/docs/introduction/what-is-photon.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,17 @@ toc_max_heading_level: 4

### Coroutine runtime

Photon's runtime is driven by a coroutine lib. Out tests show that it has the [**best**](../performance/network-performance#2-ping-pong) IO performance in the open source world by the year of 2022, even among different programing languages.
Photon's runtime is driven by a coroutine lib. Out tests show that it has the [**best 🔗**](../performance/network-performance#2-ping-pong) IO performance in the open source world by the year of 2022, even among different programing languages.


### Features
### Core Features

* Stackful coroutine. Symmetric scheduler.
* Non-blocking IO engine. Async event engine. Support epoll / kqueue / **io_uring**.
* Support multiple platforms and architectures, x86 / ARM, Linux / macOS.
* Well-designed assembly code on the critical path, to reduce overhead.
* Fully compatible API toward C++ std and POSIX. Easy to migrate to legacy codebases.

### Functionalities

* Multiple IO wrappers: psync, posix_aio, libaio, io_uring
* Multiple socket implementations: tcp (level-trigger/edge-trigger), unix-domain, zero-copy, libcurl, TLS support, etc.
* High performance RPC client/server, HTTP client/server.
* A POSIX-like filesystem abstraction and some implementations: local fs, http fs, f fs, etc.
* A bunch of useful tools: io-vector manipulation, resource pool, object cache, mem allocator, callback delegator,
pre-compiled logging, lockless ring buffer, etc.

### Users

Some open source projects are using Photon as well, for instance:
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/introduction/write-first-example.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 4
sidebar_position: 5
toc_max_heading_level: 4
---

Expand Down

0 comments on commit 87dfc84

Please sign in to comment.