Commit 30704d2
committed
librc: fix unnecessary copying parent memory page table
posix_spawn() is a more lightweight and modern alternative to fork()/exec(), which are used inside popen(). The main advantage of posix_spawn is that it can create a new process without completely duplicating the address space of the parent process.
References:
- https://blog.famzah.net/2018/12/19/posix_spawn-performance-benchmarks-and-usage-examples/
- https://lobste.rs/s/smbsd5/fork_road
- https://www.reddit.com/r/C_Programming/comments/1lvdhp2/fork_vs_posix_spawn/1 parent 584444d commit 30704d2
1 file changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
791 | 792 | | |
792 | 793 | | |
793 | 794 | | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
794 | 798 | | |
795 | 799 | | |
796 | 800 | | |
797 | | - | |
| 801 | + | |
798 | 802 | | |
799 | 803 | | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
800 | 816 | | |
801 | 817 | | |
802 | 818 | | |
| |||
876 | 892 | | |
877 | 893 | | |
878 | 894 | | |
879 | | - | |
| 895 | + | |
880 | 896 | | |
881 | 897 | | |
882 | 898 | | |
| |||
0 commit comments