aspose file tools*
The moose likes Linux / UNIX and the fly likes Corn Job vs MultiThreading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Corn Job vs MultiThreading" Watch "Corn Job vs MultiThreading" New topic
Author

Corn Job vs MultiThreading

Gavi Raaghav
Ranch Hand

Joined: Apr 28, 2005
Posts: 82
I have a scenario where a scheduler, invoked by a cron job, would pick up list of timings at which a file processor should run.
The scheduler should invoke the file processor at different timings as picked from the database.
The file processor can either be cron jobs or it can be threads.
Each file processor will work on independent files and they would update independently.
The business scenario is such that you will not have any conditions of deadlock on any resource.

What is better to use Corn or Multithreading?
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

I see no substantive benefit to using threads in this case.

Nor any advanced Java stuff, either...moving to the Unix forum.
[ July 20, 2005: Message edited by: Michael Ernest ]

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

How often do the time-definitions in the database change (update, remove, insert)?
Do you like to do this in a 2-step scheduling:

I never created cron-jobs programmatically, but I don't see a problem in creating them from a database.

If jobs get defined typically shortly (few minutes) before the defined time, and have to be executed the same day, I would have a look at the 'at' command.



http://home.arcor.de/hirnstrom/bewerbung
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

Or, if you're doing one-shot delayed jobs, use the "at" command.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Corn Job vs MultiThreading