C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scheduling Tasks

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Joe
Guest





PostPosted: Fri Mar 05, 2004 12:37 am    Post subject: Scheduling Tasks Reply with quote



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?


Back to top
Julie
Guest





PostPosted: Fri Mar 05, 2004 12:43 am    Post subject: Re: Scheduling Tasks Reply with quote



Joe wrote:
Quote:

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

Back to top
Chris ( Val )
Guest





PostPosted: Fri Mar 05, 2004 11:49 am    Post subject: Re: Scheduling Tasks Reply with quote




"Joe" <anon (AT) anon (DOT) com> wrote

Quote:
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 Smile.

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

Cheers.
Chris Val



Back to top
Joe
Guest





PostPosted: Fri Mar 05, 2004 11:53 am    Post subject: Re: Scheduling Tasks Reply with quote


"Chris ( Val )" <chrisval (AT) bigpond (DOT) com.au> wrote

Quote:

"Joe" <anon (AT) anon (DOT) com> wrote in message
news:BXP1c.13214$x37.9779 (AT) newsfe3-win (DOT) server.ntli.net...
| 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 Smile.

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.



Back to top
Chris ( Val )
Guest





PostPosted: Fri Mar 05, 2004 11:59 am    Post subject: Re: Scheduling Tasks Reply with quote


"Joe" <anon (AT) anon (DOT) com> wrote

Quote:

"Chris ( Val )" <chrisval (AT) bigpond (DOT) com.au> wrote in message
news:c29pfv$1qvs2u$1 (AT) ID-110726 (DOT) news.uni-berlin.de...

"Joe" <anon (AT) anon (DOT) com> wrote in message
news:BXP1c.13214$x37.9779 (AT) newsfe3-win (DOT) server.ntli.net...
| 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 Smile.

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



Back to top
Karl Heinz Buchegger
Guest





PostPosted: Fri Mar 05, 2004 3:22 pm    Post subject: Re: Scheduling Tasks Reply with quote

"Chris ( Val )" wrote:
Quote:

"Joe" <anon (AT) anon (DOT) com> wrote in message
news:HRZ1c.13450$x37.5225 (AT) newsfe3-win (DOT) server.ntli.net...
|
| "Chris ( Val )" <chrisval (AT) bigpond (DOT) com.au> wrote in message
| news:c29pfv$1qvs2u$1 (AT) ID-110726 (DOT) news.uni-berlin.de...
|
| > "Joe" <anon (AT) anon (DOT) com> wrote in message
| > news:BXP1c.13214$x37.9779 (AT) newsfe3-win (DOT) server.ntli.net...
| > | 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 Smile
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
[email]kbuchegg (AT) gascad (DOT) at[/email]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.