Re: Program that wakes up every hour
- From: "waiting for" <gunwithrose@xxxxxxxxx>
- Date: 22 Mar 2007 01:45:37 -0700
On 3月22日, 下午12时15分, "Digital Puer" <digital_p....@xxxxxxxxxxx> wrote:
I have a C++ program running on Red Hat Linux
that needs to wake up every hour, read a database
through ODBC, and perform accumulations and
other calculations (e.g. to count inventory sold
in the last hour). The problem is such that there
are so many transactions around the world that
real-time aggregation is not feasible, so it must
be done hourly.
I have several design choices:
1. The program can always be running. It can call
sleep() to sleep the remaining minutes until the next
hour.
2. The program can block on, say, a named pipe,
and another hourly program can write to the named
pipe to wake it up. This hourly program can be
started by cron.
3. The program can itself be stateless and kicked
off by cron. When it's started, it reads the database,
runs calculations, and writes back immediately
to the database.
Any opinions?
I think using a timer is a good idea! Isn't it?
.
- References:
- Program that wakes up every hour
- From: Digital Puer
- Program that wakes up every hour
- Prev by Date: Re: function remove() deletes bytes of a file , but not the file itself
- Next by Date: Re: Meet a problem when using the signals
- Previous by thread: Re: Program that wakes up every hour
- Next by thread: Re: Program that wakes up every hour
- Index(es):
Relevant Pages
|