Re: Automatic notification to application based on system date and time (Monta-vista linux)



Jan Panteltje <pNaonStpealmtje@xxxxxxxxx> writes:

On a sunny day (28 Sep 2006 03:53:15 -0700) it happened "dadu"
<amol.bhopale@xxxxxxxxx> wrote in
<1159440795.332584.175310@xxxxxxxxxxxxxxxxxxxxxxxxxxx>:

I need OS support in my application to receive signal or event from OS
when I configure it for particular date and time. In short, I am
expecting OS notification in my application on particular date and
time. Can anybody please help me on, how to implement this on linux?

Your program could poll getdate() every second, and compare year, month,
monthday, hour, minute and second to your 'setpoint'.

Why? Check the date when the program starts and from time to time
under normal operation. When the configured time is approaching you
can set a timer (or you could have a timer to make the checks
regularly, if there otherwise is no code guaranteed to execute "from
time to time").

You can also use crontab to start a program, but I think crontab does not
care about years.

No big deal: as the program starts or gets a signal it can make more
detailed checks. The thing to look out for is that cron doesn't do
things retroactively: if the time was missed (because of downtime, day
light saving time, setting the system clock, whatever) you will never
know.

Polling getdate() once a second is not a big system load.

But is unnecessary and probably makes the program more complicated.

--
Lajos Parkatti

.



Relevant Pages

  • Re: File system change notifications
    ... notification for the same file) which might appear the same in the ... the notification is just a duplicate of a previous one so I must ... Also note although Brian uses a API based timer with a hidden window, that really does nothing substantial over the VB6 timer component. ...
    (microsoft.public.vb.general.discussion)
  • Re: [PATCH] virtio_net: free transmit skbs in a timer
    ... enables interrupts and waits for notification that more ... to let TX packets "hang out" in the TX ring unreclaimed ... Add a timer to ensure that any time we queue new TX ... networking and depend on timely completion notification. ...
    (Linux-Kernel)
  • Re: Timer problem
    ... Andy Baker ... I'd use the notification system. ... My problem is that while the connection is active, I disable the timer ... The Connection class raises a 'completed' event ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: [take12 0/3] kevent: Generic event handling mechanism.
    ... Since this is the sixthevent notification system that's getting ... userspace API is right this time? ... Just looking at the proposed kevent API, it appears that the timer event ...
    (Linux-Kernel)
  • Process Monitor Hooks
    ... Notification should receive the information about the process as well. ... Whenever a timer is fired - i get list of all the ... 2- Somehoe Hook into this process creation/destruction ... I think the timer option will be less expensive in the form of ...
    (microsoft.public.win32.programmer.kernel)