Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Corn Job vs MultiThreading

 
Gavi Raaghav
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18156
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or, if you're doing one-shot delayed jobs, use the "at" command.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic