Processes to record topic generations before execution

The sigchld generation expresses the idea that, if we receive a sigchld
signal, the generation will be different than when we last recorded it. A
process cannot exit before it has launched, so check the generation count
before process launch. This is an optimization that reduces failing
waitpid calls.
This commit is contained in:
ridiculousfish
2019-02-16 17:35:16 -08:00
parent a95bc849c5
commit ebe2dc2766
3 changed files with 11 additions and 1 deletions

View File

@@ -324,7 +324,11 @@ static void handle_child_status(pid_t pid, int status) {
}
}
process_t::process_t() {}
process_t::process_t() = default;
void process_t::check_generations_before_launch() {
gens_ = topic_monitor_t::principal().current_generations();
}
job_t::job_t(job_id_t jobid, io_chain_t bio, std::shared_ptr<job_t> parent)
: block_io(std::move(bio)),