#279 replaced vfork calls with fork, but fork can perform substantially worse when the process has a large memory footprint.
Ideally we would use posix_spawn instead, but (when setting the cwd) this requires posix_spawn_file_actions_addchdir. There seems to be an inconsistency as the configure script looks for posix_spawn_file_actions_addchdir but do_spawn_posix tests for the _np version. Presumably that should be fixed, though it isn't clear whether glibc has added support for posix_spawn_file_actions_addchdir (without _np) yet; perhaps we should test for both the portable and non-portable versions?
Since there may be other cases where posix_spawn cannot be used, I wonder if we should retain vfork support as well (preferring posix_spawn if possible, and falling back on fork if vfork is not available).
cc @bgamari
#279 replaced
vforkcalls withfork, butforkcan perform substantially worse when the process has a large memory footprint.Ideally we would use
posix_spawninstead, but (when setting the cwd) this requiresposix_spawn_file_actions_addchdir. There seems to be an inconsistency as theconfigurescript looks forposix_spawn_file_actions_addchdirbutdo_spawn_posixtests for the_npversion. Presumably that should be fixed, though it isn't clear whetherglibchas added support forposix_spawn_file_actions_addchdir(without_np) yet; perhaps we should test for both the portable and non-portable versions?Since there may be other cases where
posix_spawncannot be used, I wonder if we should retainvforksupport as well (preferringposix_spawnif possible, and falling back onforkifvforkis not available).cc @bgamari