Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > App in the background

Reply
Thread Tools

App in the background

 
 
mark13.pl@gmail.com
Guest
Posts: n/a
 
      08-31-2006
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

 
Reply With Quote
 
 
 
 
Martin Gregorie
Guest
Posts: n/a
 
      09-01-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) 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 |
 
Reply With Quote
 
 
 
 
mark13.pl@gmail.com
Guest
Posts: n/a
 
      09-01-2006
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

 
Reply With Quote
 
Martin Gregorie
Guest
Posts: n/a
 
      09-01-2006
(E-Mail Removed) 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 |
 
Reply With Quote
 
Mark Space
Guest
Posts: n/a
 
      09-02-2006
(E-Mail Removed) 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.
 
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
DIV background-repeat background-image? For shadow effect jc ASP .Net 3 03-19-2008 04:19 PM
DIV background-repeat background-image for shadowing effect jc HTML 1 03-19-2008 02:16 PM
not able to click on background tab and backgrounds in properties to change the background. rex Computer Support 2 12-06-2006 02:26 AM
Background transparent when 'background' is used JWL HTML 4 09-26-2006 05:37 PM
Background Check - Background search - People search mason66 ASP .Net 0 07-27-2006 10:20 AM



Advertisments