File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Corn Job vs MultiThreading" Watch "Corn Job vs MultiThreading" New topic

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

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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

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

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Corn Job vs MultiThreading
It's not a secret anymore!