Re: elegant and effective way for running jobs inside a database - Mailing list pgsql-hackers

From Kohei KaiGai
Subject Re: elegant and effective way for running jobs inside a database
Date
Msg-id CADyhKSWB7dTWXbpUgba3u1mXMrtbH++QkbT6wNcAsSPcTJj+FA@mail.gmail.com
Whole thread Raw
In response to Re: elegant and effective way for running jobs inside a database  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: elegant and effective way for running jobs inside a database  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
2012/3/6 Alvaro Herrera <alvherre@commandprompt.com>:
> It seems to me that the only thing that needs core support is the
> ability to start up the daemon when postmaster is ready to accept
> queries, and shut the daemon down when postmaster kills backends (either
> because one crashed, or because it's shutting down).
>
+10

Even though it is different from the original requirement, I also would
like to see the feature to run daemon processes managed by extension
according to start/stop of the postmaster.

I'm trying to implement an extension that uses GPU devices to help
calculation of complex qualifiers. CUDA or OpenCL has a limitation
that does not allow a particular number of processes open a device
concurrently.
So, I launches calculation threads that handles all the communication
with GPU devices behalf on the postmaster process, however, it is not
a graceful design, of course.
Each backend communicate with the calculation thread via shared-
memory segment, thus, it should be a child process of postmaster.

So, although my motivation is not something like Cron in core,
it seems to me Alvaro's idea is quite desirable and reasonable,
to be discussed in v9.3.

Thanks,
-- 
KaiGai Kohei <kaigai@kaigai.gr.jp>


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: pg_prewarm
Next
From: Tom Lane
Date:
Subject: Re: xlog location arithmetic