Program that wakes up every hour
- From: "Digital Puer" <digital_puer@xxxxxxxxxxx>
- Date: 21 Mar 2007 21:15:16 -0700
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?
.
- Follow-Ups:
- Re: Program that wakes up every hour
- From: Daniel Rudy
- Re: Program that wakes up every hour
- From: David T. Ashley
- Re: Program that wakes up every hour
- From: Lew Pitcher
- Re: Program that wakes up every hour
- From: waiting for
- Re: Program that wakes up every hour
- From: Ian Collins
- Re: Program that wakes up every hour
- Prev by Date: Re: Meet a problem when using the signals
- Next by Date: Re: Does exit() imply signal when using diff utility?
- Previous by thread: Does exit() imply signal when using diff utility?
- Next by thread: Re: Program that wakes up every hour
- Index(es):
Relevant Pages
|
Loading