Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

App in the background

Thread view: 
mark13.pl@gmail.com - 31 Aug 2006 22:39 GMT
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
Martin Gregorie - 01 Sep 2006 01:11 GMT
> 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
[quoted text clipped - 5 lines]
> 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....

Signature

martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

mark13.pl@gmail.com - 01 Sep 2006 11:20 GMT
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
Martin Gregorie - 01 Sep 2006 13:42 GMT
> Hello,
>
[quoted text clipped - 3 lines]
>
> 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.

Signature

martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Mark Space - 02 Sep 2006 19:01 GMT
> Hello,
>
[quoted text clipped - 5 lines]
>
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.