Skip to content

Commit

Permalink
add stack reduce/restore
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Dec 13, 2023
1 parent 8ac9c0d commit 8ce9d89
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ should follow when writing programs that use coroutines:
> but it's **safe** if your code is not sensitive about the previous state of TLS. Or there is no coroutines scheduling between **set** TLS and **use** TLS.
* Don't run CPU bound tasks for long time, but it's ok if you don't care about fairness;
* Don't run thread::sleep() on mco coroutine
* In most modern operating systems, when starting a process, the standard Thread stack size is usually 8 MB, and mco provides a maximum stack space of 6MB. Typically, operating systems load memory pages on demand, such as starting about 1 million processes on my Mac/Unix system, which requires 15GB of memory space.
* Don't exceed the coroutine stack. There is a guard page for each coroutine stack. When stack overflow occurs, it will
trigger segment fault error.
Expand Down

0 comments on commit 8ce9d89

Please sign in to comment.