Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Scheduling Tasks

Reply
Thread Tools

Scheduling Tasks

 
 
Joe
Guest
Posts: n/a
 
      03-05-2004
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?


 
Reply With Quote
 
 
 
 
Julie
Guest
Posts: n/a
 
      03-05-2004
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-lit...t.html#faq-5.9
 
Reply With Quote
 
 
 
 
Chris \( Val \)
Guest
Posts: n/a
 
      03-05-2004

"Joe" <(E-Mail Removed)> wrote in message
news:BXP1c.13214$(E-Mail Removed)...
| 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


 
Reply With Quote
 
Joe
Guest
Posts: n/a
 
      03-05-2004

"Chris ( Val )" <(E-Mail Removed)> wrote in message
news:c29pfv$1qvs2u$(E-Mail Removed)-berlin.de...
>
> "Joe" <(E-Mail Removed)> wrote in message
> news:BXP1c.13214$(E-Mail Removed)...
> | 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.


 
Reply With Quote
 
Chris \( Val \)
Guest
Posts: n/a
 
      03-05-2004

"Joe" <(E-Mail Removed)> wrote in message
news:HRZ1c.13450$(E-Mail Removed)...
|
| "Chris ( Val )" <(E-Mail Removed)> wrote in message
| news:c29pfv$1qvs2u$(E-Mail Removed)-berlin.de...
| >
| > "Joe" <(E-Mail Removed)> wrote in message
| > news:BXP1c.13214$(E-Mail Removed)...
| > | 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


 
Reply With Quote
 
Karl Heinz Buchegger
Guest
Posts: n/a
 
      03-05-2004
"Chris ( Val )" wrote:
>
> "Joe" <(E-Mail Removed)> wrote in message
> news:HRZ1c.13450$(E-Mail Removed)...
> |
> | "Chris ( Val )" <(E-Mail Removed)> wrote in message
> | news:c29pfv$1qvs2u$(E-Mail Removed)-berlin.de...
> | >
> | > "Joe" <(E-Mail Removed)> wrote in message
> | > news:BXP1c.13214$(E-Mail Removed)...
> | > | 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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in scheduling tasks santu_srisoft General Computer Support 1 06-22-2009 12:57 AM
dates, scheduling tasks, mysql Comfort Eagle Ruby 3 12-05-2006 11:01 PM
Scheduling a screen-scraping progam on a locked PC? =?Utf-8?B?VGludGluTWlsb3U=?= Microsoft Certification 7 01-12-2005 06:19 PM
Scheduling a .NET component arcvonz ASP .Net 1 08-17-2004 11:16 PM
scheduling actions vsakel Cisco 2 12-26-2003 02:51 PM



Advertisments