Program that wakes up every hour



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?

.



Relevant Pages

  • Re: Program that wakes up every hour
    ... other calculations (e.g. to count inventory sold ... and another hourly program can write to the named ... pipe to wake it up. ... When it's started, it reads the database, ...
    (comp.unix.programmer)
  • Re: Program that wakes up every hour
    ... other calculations (e.g. to count inventory sold ... and another hourly program can write to the named ... pipe to wake it up. ... When it's started, it reads the database, ...
    (comp.unix.programmer)
  • Re: How to wake up an asynchroneous process ?
    ... The ASP activity from A may occur when there is no active login, ... A should not "wake up" B, but B should periodically poll the data. ... My asp.net application A stores data in an SQL 2000 database. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Program that wakes up every hour
    ... other calculations (e.g. to count inventory sold ... pipe to wake it up. ... started by cron. ... When it's started, it reads the database, ...
    (comp.unix.programmer)
  • Clarion/Oracle - Dealing with double quotations "
    ... I have a clarion 6 program running on an Oracle 9i database. ... return within the cell, the text comes in like this: ... i.e. Windows is adding in the double quotations around the text. ... It gets imported into the database fine, but the problem is the TList ...
    (comp.lang.clarion)

Loading