Re: [v9.3] Extra Daemons (Re: elegant and effective way for running jobs inside a database)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Kohei KaiGai <kaigai@kaigai.gr.jp>, Simon Riggs <simon@2ndquadrant.com>, Andrew Dunstan <andrew@dunslane.net>, Robert Haas <robertmhaas@gmail.com>, "David E. Wheeler" <david@justatheory.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2012-11-19T21:25:27Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes: > Kohei KaiGai escribi: >> StartOneBackgroundWorker always scan the BackgroundWorkerList from >> the head. Isn't it available to save the current position at static variable? >> If someone tries to manage thousand of bgworkers, it makes a busy loop. :( > Seems messy; we would have to get into the guts of slist_foreach (unroll > the macro and make the iterator static). I prefer not to go that path, > at least not for now. Thousands of bgworkers seems like a pretty unsupportable scenario anyway --- it'd presumably have most of the same problems as thousands of backends. regards, tom lane