On 10/4/16 10:16 AM, Julien Rouhaud wrote: > Please find attached v9 of the patch, adding the parallel worker class > and changing max_worker_processes default to 16 and max_parallel_workers > to 8. I also added Amit's explanation for the need of a write barrier > in ForgetBackgroundWorker().
This approach totally messes up the decoupling between the background worker facilities and consumers of those facilities. Having dozens of lines of code in bgworker.c that does the accounting and resource checking on behalf of parallel.c looks very suspicious. Once we add logical replication workers or whatever, we'll be tempted to add even more stuff in there and it will become a mess. I think we should think of a way where we can pass the required information during background worker setup, like a pointer to the resource-limiting GUC variable. For style, I would also prefer the "class" to be a separate struct field from the flags. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers