Re: Program that wakes up every hour



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?

.



Relevant Pages

  • 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)
  • Program that wakes up every hour
    ... I have a C++ program running on Red Hat Linux ... 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: Requery on command button not working
    ... Are these calculations coming from "across the ... See http://www.QBuilt.com for all your database needs. ... >> The CPU is busy executing your request. ... >>> buttons the intention is to display the releveant data for that period. ...
    (microsoft.public.access.forms)
  • Re: why>?
    ... i haven't ever been asked to build a point of sale system in excel you ... Access is flexible enough to work with any existing database backend. ... people shouldln't have to be software developers? ... that sensible people who need to perform many calculations will try to ...
    (microsoft.public.excel)

Quantcast