Skip to content

Commit 5246a41

Browse files
authored
Update English README.md. (#1790)
1 parent 65f044b commit 5246a41

1 file changed

Lines changed: 20 additions & 21 deletions

File tree

README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int main()
4444
* This project has built-in **service governance** and **load balancing** features.
4545
* Wiki link : [PaaS Architecture](https://github.com/sogou/workflow/wiki)
4646

47-
#### Compiling and running environment
47+
#### Compiling and Running Environment
4848

4949
* This project supports `Linux`, `macOS`, `Windows`, `Android` and other operating systems.
5050
* `Windows` version is currently released as an independent [branch](https://github.com/sogou/workflow/tree/windows), using `iocp` to implement asynchronous networking. All user interfaces are consistent with the `Linux` version.
@@ -53,7 +53,7 @@ int main()
5353
* Uses the `C++11` standard and therefore, it should be compiled with a compiler which supports `C++11`. Does not rely on `boost` or `asio`.
5454
* No other dependencies. However, if you need `Kafka` protocol, some compression libraries should be installed, including `lz4`, `zstd` and `snappy`.
5555

56-
### Get started (Linux, macOS):
56+
### Get Started (Linux, macOS):
5757
~~~sh
5858
git clone https://github.com/sogou/workflow
5959
cd workflow
@@ -134,9 +134,9 @@ If you want to use xmake to build workflow, you can see [xmake build document](d
134134
* [Asynchronous MySQL client:mysql\_cli](docs/en/tutorial-12-mysql_cli.md)
135135
* [Asynchronous Kafka client: kafka\_cli](docs/en/tutorial-13-kafka_cli.md)
136136

137-
#### Programming paradigm
137+
#### Programming Paradigm
138138

139-
We believe that a typical back-end program=protocol+algorithm+workflow and should be developed completely independently.
139+
Program = Protocol + Algorithm + Workflow
140140

141141
* Protocol
142142
* In most cases, users use built-in common network protocols, such as HTTP, Redis or various rpc.
@@ -151,35 +151,34 @@ We believe that a typical back-end program=protocol+algorithm+workflow and shoul
151151
* The typical workflow is a closed series-parallel graph. Complex business logic may be a non-closed DAG.
152152
* The workflow graph can be constructed directly or dynamically generated based on the results of each step. All tasks are executed asynchronously.
153153

154-
Basic task, task factory and complex task
154+
Structured Concurrency and Task Abstraction
155155

156-
* Our system contains six basic tasks: networking, file IO, CPU, GPU, timer, and counter.
157-
* All tasks are generated by the task factory and automatically recycled after callback.
158-
* Server task is one kind of special networking task, generated by the framework which calls the task factory, and handed over to the user through the process function.
159-
* In most cases, the task generated by the user through the task factory is a complex task, which is transparent to the user.
156+
* Our system contains five basic tasks: communication, computation, file IO, timer, and counter.
157+
* All tasks are generated by the task factory, and users organize the concurrency structure by calling interfaces, such as series, parallel, DAG, etc.
158+
* In most cases, the tasks generated by the user through the task factory is a complex task which encapsulates multiple asynchronous processes, but it is transparent to the user.
160159
* For example, an HTTP request may include many asynchronous processes (DNS, redirection), but for user, it is just a networking task.
161160
* File sorting seems to be an algorithm, but it actually includes many complex interaction processes between file IO and CPU computation.
162161
* If you think of business logic as building circuits with well-designed electronic components, then each electronic component may be a complex circuit.
162+
* The task abstraction mechanism greatly reduces the number of tasks users need to create and the depth of callbacks.
163+
* Any task runs in a **SeriesWork** and the tasks in the same SeriesWork shares the series context, which simplifies data transfer between asynchronous tasks.
163164

164-
Asynchrony and encapsulation based on `C++11 std::function`
165+
Callback and Memory Reclamation Mechanism
165166

166-
* Not based on user mode coroutines. Users need to know that they are writing asynchronous programs.
167167
* All calls are executed asynchronously, and there is almost no operation that occupies a thread.
168-
* Although we also provide some facilities with semi-synchronous interfaces, they are not core features.
168+
* Explicit callback mechanism. Users are aware that they are writing asynchronous programs.
169+
* **A set of object lifecycle mechanisms greatly simplifies memory management for asynchronous programs.**
170+
* The lifecycle of any task created by the framework is from creation until the callback function finishes running. There is no risk of leakage.
171+
* If a task is created but the user does not want to run it, the user needs to release it through the `dismiss()` interface.
172+
* Any data in the task, such as the response of the network request, will also be recycled with the task. At this time, the user can use `std::move()` to move the required data.
173+
* The project doesn’t use `std::shared_ptr` to manage memory.
174+
169175
* We try to avoid user's derivations, and encapsulate user behavior with `std::function` instead, including:
170176
* The callback of any task.
171177
* Any server's process. This conforms to the `FaaS` (Function as a Service) idea.
172178
* The realization of an algorithm is simply a `std::function`. But the algorithm can also be implemented by derivation.
179+
* If used deeply, one will find that everything can be derived.
173180
174-
Memory reclamation mechanism
175-
176-
* Every task will be automatically reclaimed after the callback. If a task is created but a user does not want to run it, the user needs to release it through the dismiss method.
177-
* Any data in the task, such as the response of the network request, will also be recycled with the task. At this time, the user can use `std::move()` to move the required data.
178-
* SeriesWork and ParallelWork are two kinds of framework objects, which are also recycled after their callback.
179-
* When a series is a branch of a parallel, it will be recycled after the callback of the parallel that it belongs to.
180-
* This project doesn’t use `std::shared_ptr` to manage memory.
181-
182-
#### Any other questions?
181+
#### Any Other Questions?
183182
184183
You may check the [FAQ](https://github.com/sogou/workflow/issues/406) and [issues](https://github.com/sogou/workflow/issues) list first to see if you can find the answer.
185184

0 commit comments

Comments
 (0)