Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement and use vfork when possible #8279

Open
bcardiff opened this issue Oct 6, 2019 · 1 comment
Open

Implement and use vfork when possible #8279

bcardiff opened this issue Oct 6, 2019 · 1 comment

Comments

@bcardiff
Copy link
Member

bcardiff commented Oct 6, 2019

We use fork/exec for running processes. Although it has some benefits regarding process isolation, it leads to higher memory demand.

For example, some of the crashes when building the compiler in 32 bits are when running the run macro to embed tool init .ecr templates.

In Go, vfork is used when available: https://github.com/golang/go/blob/master/src/syscall/exec_linux.go.

When the API is known for sure that running program needs to wait for the subprocess to finish in order to continue there could be a benefit of using vfork.

@ysbaddaden
Copy link
Contributor

Maybe also check posix_spawn as an alternative? It internally uses vfork over fork on linux when possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants