App in the background

Discussion in 'Java' started by mark13.pl@gmail.com, Aug 31, 2006.

  1. Guest

    Hello,

    I would like to write stand-alone application which would download some
    files from network every x hrs (specified by the user). I think I would
    do it that, that user would just specify the time and minimalize it (it
    will be minimalized or I will decide to put it to systray) and then app
    every x hrs will wake up and do its job.

    How can I do it without slowing a lot OS (processor/memory)? I was
    thinking about threads and wait/sleep function but not know if it is
    effective method. What do you think?!?

    Regards, mark
     
    , Aug 31, 2006
    #1
    1. Advertising

  2. wrote:
    >
    > I would like to write stand-alone application which would download some
    > files from network every x hrs (specified by the user). I think I would
    > do it that, that user would just specify the time and minimalize it (it
    > will be minimalized or I will decide to put it to systray) and then app
    > every x hrs will wake up and do its job.
    >
    > How can I do it without slowing a lot OS (processor/memory)? I was
    > thinking about threads and wait/sleep function but not know if it is
    > effective method. What do you think?!?
    >

    You don't say what your target OS is or if you want to write a OS you're
    running on or if you want to write something that's OS-agnostic so its
    difficult to give specific advice.

    Personally, I'd do it with cron because then there are no overheads at
    all. However, I do run Linux....


    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
     
    Martin Gregorie, Sep 1, 2006
    #2
    1. Advertising

  3. Guest

    Hello,

    > You don't say what your target OS is or if you want to write a OS you're
    > running on or if you want to write something that's OS-agnostic so its
    > difficult to give specific advice.


    It is going to be MS Windows.

    Regards, mark
     
    , Sep 1, 2006
    #3
  4. wrote:
    > Hello,
    >
    >> You don't say what your target OS is or if you want to write a OS you're
    >> running on or if you want to write something that's OS-agnostic so its
    >> difficult to give specific advice.

    >
    > It is going to be MS Windows.
    >

    Have you considered writing the application so it does the transfers you
    need and then quits and running it under the control of the Windows
    Scheduler?

    Tis way you get a simple application and there's already a GUI (supplied
    by MS) that can control when it gets run.


    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
     
    Martin Gregorie, Sep 1, 2006
    #4
  5. Mark Space Guest

    wrote:
    > Hello,
    >
    >> You don't say what your target OS is or if you want to write a OS you're
    >> running on or if you want to write something that's OS-agnostic so its
    >> difficult to give specific advice.

    >
    > It is going to be MS Windows.
    >
    > Regards, mark
    >


    Yes, ditto to what Martin said. Much better to use the OS features than
    to try to do everything yourself.

    On Windows 2000 (mine), there's a control panel for this:

    Start->Programs->Accessories->System Tools->Scheduled Tasks

    Encourage the user to place your app here. This provides effectively 0%
    overhead, just like cron. I don't think there's any way you can provide
    that. Just having the JVM up at all is a pretty large overhead, if it's
    going to be doing nothing except expiring a counter every 24 hours.

    Also, think about other paradigms. If you are updating another app,
    consider having it check for updates whenever its run.
     
    Mark Space, Sep 2, 2006
    #5
    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. mason66
    Replies:
    0
    Views:
    426
    mason66
    Jul 27, 2006
  2. JWL
    Replies:
    4
    Views:
    591
    Michael Winter
    Sep 26, 2006
  3. jc
    Replies:
    3
    Views:
    1,733
  4. jc
    Replies:
    1
    Views:
    1,372
    Neredbojias
    Mar 19, 2008
  5. Dj Frenzy
    Replies:
    3
    Views:
    312
    Robert
    Feb 10, 2004
Loading...

Share This Page