Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#include "attribute.hpp"
#include "thread.hpp"
#include "platform.hpp"
#include "plugin.hpp"

static int low_detail = 12;
static int full_detail = -1;
Expand Down Expand Up @@ -3714,6 +3715,14 @@ int main(int argc, char **argv) {

signal(SIGPIPE, SIG_IGN);

// Pre-fork the filter worker pool while we are still single-threaded.
// Spawning them now (before any reader or tiling threads) means each
// worker is a clean, single-threaded process, so its later fork()s
// for the prefilter/postfilter shells are cheap and safe.
if (prefilter != NULL || postfilter != NULL) {
filter_workers_init(CPUS);
}

files_open_at_start = open(get_null_device(), O_RDONLY | O_CLOEXEC);
if (files_open_at_start < 0) {
perror("open /dev/null");
Expand Down
Loading
Loading