Questions tagged [scheduling]

In computer science, scheduling is the method by which threads, processes or data flows are given access to system resource.

Source: "Scheduling (computing)" article on Wikipedia

Types of scheduling

  • Round-robin

    Processes are given a set amount of time. For more information see

  • First come first serve

    Processes are executed in the order of the queue.

  • Shortest job first

    Processes are executed in order of estimated time.

  • Shortest remaining time

    Similar to shortest job first; however, if a new, shorter process joins the queue, then the scheduler will switch to that one.

  • Multi-level feedback queue

    There is more than just one queue, each queue has a certain priority and the scheduler can move jobs between queues when necessary. Modern operating systems like Windows use this.

2772 questions
61
votes
5 answers

Spring Scheduling: @Scheduled vs Quartz

I'm reading the Spring 3.0 docs regarding scheduling. I'm leaning towards Spring's JobDetailBean for Quartz. However, the @Scheduled annotation has captured my eye. It appears this is another way of scheduling task using the Spring Framework. Based…
chris
  • 3,820
  • 6
  • 36
  • 36
55
votes
7 answers

How can I see which CPU core a thread is running in?

In Linux, supposing a thread's pid is [pid], from the directory /proc/[pid] we can get many useful information. For example, these proc files, /proc/[pid]/status,/proc/[pid]/stat and /proc/[pid]/schedstat are all useful. But how can I get the CPU…
flypen
  • 2,515
  • 4
  • 34
  • 51
52
votes
2 answers

Linux SCHED_OTHER, SCHED_FIFO and SCHED_RR - differences

Can someone explain the differences between SCHED_OTHER, SCHED_FIFO and SCHED_RR? Thanks
eve
  • 2,959
  • 4
  • 21
  • 18
50
votes
13 answers

PHP: running scheduled jobs (cron jobs)

I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend? What I’ve thought out so far is having a script included in the top of every page and then let this script check whether…
ehm
  • 23,789
  • 5
  • 28
  • 31
46
votes
1 answer

Class Scheduling to Boolean satisfiability [Polynomial-time reduction]

I have some theoretical/practical problem and I don't have clue for now on how to manage, Here it is: I create a SAT solver able to find a model when one is existing and to prove the contradiction when it's not the case on CNF problems in C using…
Valentin Montmirail
  • 2,594
  • 1
  • 25
  • 53
44
votes
6 answers

Tennis match scheduling

There are a limited number of players and a limited number of tennis courts. At each round, there can be at most as many matches as there are courts. Nobody plays 2 rounds without a break. Everyone plays a match against everyone else. Produce the…
Ingdas
  • 1,446
  • 1
  • 11
  • 21
44
votes
9 answers

Run a powershell script in the background once per minute

I want a powershell script to be run once per minute in the background. No window may appear. How do I do it?
magol
  • 6,135
  • 17
  • 65
  • 120
43
votes
4 answers

how to shield a cpu from the linux scheduler (prevent it scheduling threads onto that cpu)?

It is possible to use sched_setaffinity to pin a thread to a cpu, increasing performance (in some situations) From the linux man page: Restricting a process to run on a single CPU also avoids the performance cost caused by the cache invalidation…
Steve Lorimer
  • 27,059
  • 17
  • 118
  • 213
41
votes
6 answers

VBA Macro On Timer style to run code every set number of seconds, i.e. 120 seconds

I have a need to run a piece of code every 120 seconds. I am looking for an easy way to do this in VBA. I know that it would be possible to get the timer value from the Auto_Open event to prevent having to use a magic number, but I can't quite get…
FinancialRadDeveloper
  • 984
  • 4
  • 13
  • 28
41
votes
2 answers

Quartz.Net how to create a daily schedule that does not gain 1 minute per day

I am trying to build a repeating daily schedule in Quartz.Net but having a few issues: First off, I build a daily schedule, repating at 12:45 Using Quartz.Net code like this: var trigger = TriggerBuilder.Create() .WithDailyTimeIntervalSchedule(s…
Bittercoder
  • 11,753
  • 10
  • 58
  • 76
40
votes
4 answers

Emacs org-mode, repeat tasks M-F but not weekends?

I have tasks that I do every day (e.g bugzilla triage), but I only do those Monday to friday. Not on the weekends. When I use something like this: SCHEDULED: <2015-02-07 Sat ++1d> It repeats it every day, including weekends. Can I change this?
Leo Ufimtsev
  • 6,240
  • 5
  • 40
  • 48
39
votes
1 answer

OpenMP Dynamic vs Guided Scheduling

I'm studying OpenMP's scheduling and specifically the different types. I understand the general behavior of each type, but clarification would be helpful regarding when to choose between dynamic and guided scheduling. Intel's docs describe dynamic…
Matt Goodrich
  • 4,875
  • 5
  • 25
  • 38
38
votes
2 answers

Does linux schedule a process or a thread?

After reading this SO question I got a few doubts. Please help in understanding. Scheduling involves deciding when to run a process and for what quantum of time. Does linux kernel schedule a thread or a process? As process and thread are not…
prasannatsm
  • 900
  • 1
  • 11
  • 19
36
votes
4 answers

Reschedule timer in android

How can I reschedule a timer. I have tried to cancel the timer/timertask and and schedule it again using a method. But its showing an exception error: Exception errorjava.lang.IllegalStateException: TimerTask is scheduled already Code I have used…
Dijo David
  • 6,175
  • 11
  • 35
  • 46
36
votes
3 answers

Crontab - simple echo not running

I've got such situation: I want to schedule a job with crontab on a linux server. I'm not super-user, so I'm editing (with crontab -l, editor vim) only my crontab file. For testing, I put there: * * * * * echo asdf And the job is not running. Is…
zlenyk
  • 922
  • 2
  • 7
  • 22