Feh / nocache

minimize caching effects
BSD 2-Clause "Simplified" License
554 stars 53 forks source link

Do SubProcess calls work as expected. #35

Closed BlamKiwi closed 5 years ago

BlamKiwi commented 5 years ago

Looking at using NoCache to test real hardware performance for storage at the filesystem level. The test suite is managed by higher level scripts (make, bash/sh, python etc). Question is, if I have a makefile or bash script spawning subprocesses, does:

nocache bash test.sh

or

nocache make

behave as if every single subprocess call in the script had nocache in their definition?

beroal commented 5 years ago

behave as if every single subprocess call in the script had nocache in their definition?

AFAIK, yes. "nocache" replaces the standard library functions because it sets the LD_PRELOAD environment variable. Environment variables are inherited by child processes.

Feh commented 5 years ago

Sorry for taking so long, I was on vacation.

Yes, unless any process unsets the LD_PRELOAD environment variable (e.g. by calling unsetenv()) and thereby prohibits the propagation, all forks will have this variable set.

I’m marking this issue fixed; feel free to open a pull request if you want to change the documentation to make this behavior clearer. Thanks!