Scheduling Tasks

Discussion in 'C++' started by Joe, Mar 5, 2004.

  1. Joe

    Joe Guest

    I have a scheduling file that has new entries added to it at random
    intervals. I wish to poll this file (say every 15 seconds) and see if there
    are new entries. If there is, I then need to run another task at time in the
    file entry. Could someone give me a few pointers about how to go about this?

    I am programming in Windows, so would using the Task Scheduler be the best
    option? I would prefer not to rely on this, because it is easily disabled,
    and interfered with by the user.


    TIA,
    Joe.

    Also, can I check whether there is better place to ask "newbie" questions? I
    am teaching myself c++ as I go, and so I have lots of questions, most of
    which are probably pretty basic to the people reading this group. Is this
    the place to ask them? I don't want to bombard the place with irritating
    questions. Should I give some indication of that they are simple questions
    in the subject line?
    Joe, Mar 5, 2004
    #1
    1. Advertising

  2. Joe

    Julie Guest

    Joe wrote:
    >
    > I have a scheduling file that has new entries added to it at random
    > intervals. I wish to poll this file (say every 15 seconds) and see if there
    > are new entries. If there is, I then need to run another task at time in the
    > file entry. Could someone give me a few pointers about how to go about this?
    >
    > I am programming in Windows, so would using the Task Scheduler be the best
    > option? I would prefer not to rely on this, because it is easily disabled,
    > and interfered with by the user.
    >
    > TIA,
    > Joe.
    >
    > Also, can I check whether there is better place to ask "newbie" questions? I
    > am teaching myself c++ as I go, and so I have lots of questions, most of
    > which are probably pretty basic to the people reading this group. Is this
    > the place to ask them? I don't want to bombard the place with irritating
    > questions. Should I give some indication of that they are simple questions
    > in the subject line?


    http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.9
    Julie, Mar 5, 2004
    #2
    1. Advertising

  3. "Joe" <> wrote in message
    news:BXP1c.13214$...
    | I have a scheduling file that has new entries added to it at random
    | intervals. I wish to poll this file (say every 15 seconds) and see if there
    | are new entries. If there is, I then need to run another task at time in the
    | file entry. Could someone give me a few pointers about how to go about this?
    |
    | I am programming in Windows, so would using the Task Scheduler be the best

    [snip]

    Oop's, you posted to the wrong group :).

    Please try a Windows group - This group limits
    it's discussions to the Standard C++ language
    only.

    Cheers.
    Chris Val
    Chris \( Val \), Mar 5, 2004
    #3
  4. Joe

    Joe Guest

    "Chris ( Val )" <> wrote in message
    news:c29pfv$1qvs2u$-berlin.de...
    >
    > "Joe" <> wrote in message
    > news:BXP1c.13214$...
    > | I have a scheduling file that has new entries added to it at random
    > | intervals. I wish to poll this file (say every 15 seconds) and see if

    there
    > | are new entries. If there is, I then need to run another task at time in

    the
    > | file entry. Could someone give me a few pointers about how to go about

    this?
    > |
    > | I am programming in Windows, so would using the Task Scheduler be the

    best
    >
    > [snip]
    >
    > Oop's, you posted to the wrong group :).
    >
    > Please try a Windows group - This group limits
    > it's discussions to the Standard C++ language
    > only.
    >
    > Cheers.
    > Chris Val
    >
    >


    Ok, just ignore that line. Is there a good method of doing it in standard
    C++? Or is a "good" method always going to be platform dependent?

    Joe.
    Joe, Mar 5, 2004
    #4
  5. "Joe" <> wrote in message
    news:HRZ1c.13450$...
    |
    | "Chris ( Val )" <> wrote in message
    | news:c29pfv$1qvs2u$-berlin.de...
    | >
    | > "Joe" <> wrote in message
    | > news:BXP1c.13214$...
    | > | I have a scheduling file that has new entries added to it at random
    | > | intervals. I wish to poll this file (say every 15 seconds) and see if
    | there
    | > | are new entries. If there is, I then need to run another task at time in
    | the
    | > | file entry. Could someone give me a few pointers about how to go about
    | this?
    | > |
    | > | I am programming in Windows, so would using the Task Scheduler be the
    | best
    | >
    | > [snip]
    | >
    | > Oop's, you posted to the wrong group :).
    | >
    | > Please try a Windows group - This group limits
    | > it's discussions to the Standard C++ language
    | > only.
    | >
    | > Cheers.
    | > Chris Val
    | >
    | >
    |
    | Ok, just ignore that line. Is there a good method of doing it in standard
    | C++? Or is a "good" method always going to be platform dependent?

    No, unfortunately there is no built in functionality in C++
    to support this kind of stuff. About the best thing you can
    do, is use std::system() from <cstdlib>, to invoke the windows
    task schedular. Note however, this will not be portable code -
    if that is what you're looking for.

    Cheers.
    Chris Val
    Chris \( Val \), Mar 5, 2004
    #5
  6. "Chris ( Val )" wrote:
    >
    > "Joe" <> wrote in message
    > news:HRZ1c.13450$...
    > |
    > | "Chris ( Val )" <> wrote in message
    > | news:c29pfv$1qvs2u$-berlin.de...
    > | >
    > | > "Joe" <> wrote in message
    > | > news:BXP1c.13214$...
    > | > | I have a scheduling file that has new entries added to it at random
    > | > | intervals. I wish to poll this file (say every 15 seconds) and see if
    > | there
    > | > | are new entries. If there is, I then need to run another task at time in
    > | the
    > | > | file entry. Could someone give me a few pointers about how to go about
    > | this?
    > | > |

    [snip]
    > | Ok, just ignore that line. Is there a good method of doing it in standard
    > | C++? Or is a "good" method always going to be platform dependent?
    >
    > No, unfortunately there is no built in functionality in C++
    > to support this kind of stuff.


    Well. Actually there is a way.
    You could use the time functions to poll the current time and when
    15 seconds have passed: open file, read file, build up data structure
    In the same loop, you check the current time and when the time specified
    has reached you start the task using system().

    But: It's not a good idea to do it that way :)
    So Chris is right: you need to use some system specific extensions
    to fight that beast. YOu can adopt the above scheme but you will
    need some sort of sleep() or delay() call to keep CPU usage low.

    --
    Karl Heinz Buchegger
    Karl Heinz Buchegger, Mar 5, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. arcvonz

    Scheduling a .NET component

    arcvonz, Aug 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,649
  2. JIK
    Replies:
    0
    Views:
    650
  3. mirek
    Replies:
    3
    Views:
    514
    Chris Jackson
    Dec 17, 2003
  4. =?Utf-8?B?Sm9obg==?=

    Job Scheduling

    =?Utf-8?B?Sm9obg==?=, Apr 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    415
    Cowboy \(Gregory A. Beamer\) [MVP]
    Apr 8, 2004
  5. Comfort Eagle

    dates, scheduling tasks, mysql

    Comfort Eagle, Nov 30, 2006, in forum: Ruby
    Replies:
    3
    Views:
    83
    Comfort Eagle
    Dec 5, 2006
Loading...

Share This Page