thread scheduling, how??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff

    #1

    thread scheduling, how??

    Hey

    ..NET 2.0

    I'm working on a winservice created in .NET 2.0. Now I want to do some
    modications to this winservice. I want this winservice at every start of a
    new month to start a thread which pulls data from several webservices and
    saves these data to table...

    So I'm wondering how to go about implementing this so that this thread is
    automatically started at a specific time. (lets say 03:30 am at day 1 on
    each month).

    maybe the winservice framework has some features for this?

    any suggestions?


  • Jon Skeet [C# MVP]

    #2
    Re: thread scheduling, how??

    On Dec 14, 9:31 am, "Jeff" <do...@spam.mew rote:
    I'm working on a winservice created in .NET 2.0. Now I want to do some
    modications to this winservice. I want this winservice at every start of a
    new month to start a thread which pulls data from several webservices and
    saves these data to table...
    >
    So I'm wondering how to go about implementing this so that this thread is
    automatically started at a specific time. (lets say 03:30 am at day 1 on
    each month).
    >
    maybe the winservice framework has some features for this?
    Is there any reason to put this into the windows service rather than
    just using a Windows scheduled task?

    Jon

    Comment

    • Jeff

      #3
      Re: thread scheduling, how??

      Thank you for the tip!

      I think maybe the way to go is to create an app which in windows server 2003
      can be configured as an scheduled task. And then make this app call the
      winservice...

      this app don't need any GUI., all it will do is retrieve information from
      webservices and save it in a database

      you agree it's best to create this app as a console app?


      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: thread scheduling, how??

        On Dec 14, 11:08 am, "Jeff" <do...@spam.mew rote:
        Thank you for the tip!
        >
        I think maybe the way to go is to create an app which in windows server 2003
        can be configured as an scheduled task. And then make this app call the
        winservice...
        Why should it call the windows service? When not just do the work
        within the scheduled task?
        this app don't need any GUI., all it will do is retrieve information from
        webservices and save it in a database
        >
        you agree it's best to create this app as a console app?
        I'd create it as a Windows application which never shows any windows -
        that way it won't try to create a new console window. On the other
        hand, I realise that makes it slightly harder to debug :(

        Jon

        Comment

        • Willy Denoyette [MVP]

          #5
          Re: thread scheduling, how??

          "Jon Skeet [C# MVP]" <skeet@pobox.co mwrote in message
          news:c71f9b09-dd43-4991-968b-58e3b5086e1c@e2 5g2000prg.googl egroups.com...
          On Dec 14, 11:08 am, "Jeff" <do...@spam.mew rote:
          >Thank you for the tip!
          >>
          >I think maybe the way to go is to create an app which in windows server
          >2003
          >can be configured as an scheduled task. And then make this app call the
          >winservice.. .
          >
          Why should it call the windows service? When not just do the work
          within the scheduled task?
          >
          >this app don't need any GUI., all it will do is retrieve information from
          >webservices and save it in a database
          >>
          >you agree it's best to create this app as a console app?
          >
          I'd create it as a Windows application which never shows any windows -
          that way it won't try to create a new console window. On the other
          hand, I realise that makes it slightly harder to debug :(
          >
          Jon


          Scheduled tasks (should ) run in a non visible desktop as they should be
          able to run when no user is logged on, so there is no need for a Windows
          Application, a (robust) Console app. is a perfect fit.

          Willy.

          Comment

          • Ben Voigt [C++ MVP]

            #6
            Re: thread scheduling, how??


            "Jon Skeet [C# MVP]" <skeet@pobox.co mwrote in message
            news:df9f3beb-9094-452c-936f-d77130f4c171@b1 g2000pra.google groups.com...
            On Dec 14, 9:31 am, "Jeff" <do...@spam.mew rote:
            >I'm working on a winservice created in .NET 2.0. Now I want to do some
            >modications to this winservice. I want this winservice at every start of
            >a
            >new month to start a thread which pulls data from several webservices and
            >saves these data to table...
            >>
            >So I'm wondering how to go about implementing this so that this thread is
            >automaticall y started at a specific time. (lets say 03:30 am at day 1 on
            >each month).
            >>
            >maybe the winservice framework has some features for this?
            >
            Is there any reason to put this into the windows service rather than
            just using a Windows scheduled task?
            The other option, if a service is needed, would be to leave a thread
            sleeping with a waitable timer, not sure what the .NET wrapper for the
            waitable timer API is.

            But definitely better not to have a service started when not needed.
            >
            Jon

            Comment

            Working...