Re: Program that wakes up every hour
- From: Daniel Rudy <spamthis@xxxxxxxxxxxx>
- Date: Sat, 24 Mar 2007 10:45:27 GMT
At about the time of 3/21/2007 9:15 PM, Digital Puer stated the following:
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?
Use cron.
--
Daniel Rudy
Email address has been base64 encoded to reduce spam
Decode email address using b64decode or uudecode -m
Why geeks like computers: look chat date touch grep make unzip
strip view finger mount fcsk more fcsk yes spray umount sleep
.
- References:
- Program that wakes up every hour
- From: Digital Puer
- Program that wakes up every hour
- Prev by Date: Re: Remove File Descriptor from poll() set
- Next by Date: Re: branch prediction optimization
- Previous by thread: Re: Program that wakes up every hour
- Next by thread: branch prediction optimization
- Index(es):
Relevant Pages
|
Loading