Questions tagged [scheduler]

A scheduler is a software component responsible for starting tasks at a given time. Many different scheduler implementations are possible, from very low-level and short-term (an operating system CPU or I/O scheduler) to high-level and long-term (a background application launcher).

The term 'scheduler', as applied to computer programming, has quite a few different meanings:

  • Low-level scheduling of system resources, such as CPU threads or I/O requests. This type of scheduler is usually tuned to emphasize a certain performance metric, such as responsiveness or data throughput. Real-time schedulers, which provide hard response time guarantees, are a specialized class of scheduler.

  • Process scheduling, whereby the OS assigns (usually using a round-robin algorithm) time slices to applications, enabling resource sharing.

  • Application-level scheduling, often used to update user-visible information on a regular basis. This is usually done using a timer which fires an event at regular intervals.

  • Task scheduling, using a background service with an associated user interface, allowing end-users to automatically start applications at a given time, and review the execution history of each application.

Because 'scheduler' is such an overloaded term, it may be wise to also include a more specific tag which better indicates the use scenario, such as , , or

3488 questions
169
votes
10 answers

How can I run an external command asynchronously from Python?

I need to run a shell command asynchronously from a Python script. By this I mean that I want my Python script to continue running while the external command goes off and does whatever it needs to do. I read this post: Calling an external command…
user76923
166
votes
2 answers

SLURM `srun` vs `sbatch` and their parameters

I am trying to understand what the difference is between SLURM's srun and sbatch commands. I will be happy with a general explanation, rather than specific answers to the following questions, but here are some specific points of confusion that can…
dkv
  • 6,602
  • 10
  • 34
  • 54
129
votes
4 answers

Python script to do something at the same time every day

I have a long running python script that I want to do someting at 01:00 every morning. I have been looking at the sched module and at the Timer object but I can't see how to use these to achieve this.
Paul McKenzie
  • 19,646
  • 25
  • 76
  • 120
83
votes
3 answers

Context switch internals

I want to learn and fill gaps in my knowledge with the help of this question. So, a user is running a thread (kernel-level) and it now calls yield (a system call I presume). The scheduler must now save the context of the current thread in the TCB…
Bruce
  • 33,927
  • 76
  • 174
  • 262
77
votes
10 answers

How to launch Windows Scheduler by command-line?

I mean to open the built-in Windows GUI from command line- not to launch by Schtasks
Helarld
73
votes
2 answers

How does cron internally schedule jobs?

How do "modern" cron daemons internally schedule their jobs? Some cronds used to schedule a run every so often via at. So after a crontab is written out, does crond: Parse the crontab for all future events and the sleep for the intervals? Poll an…
Jé Queue
  • 10,359
  • 13
  • 53
  • 61
58
votes
9 answers

Start a Function at Given Time

How can I run a function in Python, at a given time? For example: run_it_at(func, '2012-07-17 15:50:00') and it will run the function func at 2012-07-17 15:50:00. I tried the sched.scheduler, but it didn't start my function. import time as…
microo8
  • 3,568
  • 5
  • 37
  • 67
57
votes
6 answers

Using Heroku Scheduler with Node.js

There is literally no tutorial about using Heroku Scheduler with Node.js. Assume that I have a function called sayHello() and I would like to run it every 10 mins. How can I use it in controller. In ruby you write rake function_name() however no…
Ali
  • 5,338
  • 12
  • 55
  • 78
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
55
votes
2 answers

Testing @Scheduled in spring

Spring offers the possibility to schedule and execute tasks at specific intervals using annotations, e.g. @Scheduled Is there a convenient way to unit test this behavior? Of course I could call the method of the bean myself, but I want to make sure…
David
  • 1,086
  • 2
  • 11
  • 18
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
48
votes
6 answers

MySQL Event Scheduler on a specific time everyday

Here's my query CREATE EVENT RESET ON SCHEDULE AT TIMESTAMP DO UPDATE `ndic`.`students` SET `status` = '0'; How can I update status to "0" at 1 pm every day. What can I use instead of TIMESTAMP?
gin
  • 873
  • 2
  • 12
  • 23
43
votes
3 answers

Linux perf events: cpu-clock and task-clock - what is the difference

Linux perf tools (some time ago named perf_events) has several builtin universal software events. Two most basic of them are: task-clock and cpu_clock (internally called PERF_COUNT_SW_CPU_CLOCK and PERF_COUNT_SW_TASK_CLOCK). But what is wrong with…
osgx
  • 90,338
  • 53
  • 357
  • 513
42
votes
3 answers

Scheduling a terminal command or script file to run daily at a specific time Mac OS X

I want to have my computer set its volume to a specific level every night at 11:45 PM. I'm running OSX 10.11.4. I can set the volume manually through terminal with osascript -e "set Volume 1.7" or as a script with set volume 1.7 I want it to be…
Naboo
  • 421
  • 1
  • 4
  • 4
38
votes
5 answers

How to set global event_scheduler=ON even if MySQL is restarted?

I want to set the event_scheduler global to ON even if MySQL is restarted; how can I achieve this? SET GLOBAL event_scheduler = ON;
nakul
  • 503
  • 1
  • 7
  • 17
1
2 3
99 100