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
15
votes
2 answers

Dataflow computing in python

I have n (typically n < 10 but it should scale) processes running on different machines and communicating through amqp using RabbitMQ. Processes are typically long running and may be implemented in any language (though most are java/python). Each…
dgorissen
  • 6,207
  • 3
  • 43
  • 52
15
votes
8 answers

round robin scheduling java iterators

I have a list of hosts in an array which represnt the servers available to do a particular job. Currently I simply iterate thru the list looking and establish comms with a host to check its not busy. If not I will send a job to it. This approach…
wmitchell
  • 5,665
  • 10
  • 37
  • 62
15
votes
3 answers

Scheduling Employees - what data structure to use?

Question I'm trying to write a simple employee Scheduling software for about 10-20 people in my software development company. After some consideration I settled on writing a web app in Python, Ruby or PHP + Postgres/MySQL DB. While designing…
M_1
  • 2,135
  • 4
  • 21
  • 24
15
votes
2 answers

SQL Server Agent Job Timeout

I have just had a scheduled SQL Server job run for longer than normal, and I could really have done with having set a timeout to stop it after a certain length of time. I might be being a bit blind on this, but I can't seem to find a way of setting…
Iain Hoult
  • 3,889
  • 5
  • 25
  • 39
15
votes
5 answers

Efficient scheduling of university courses

I'm currently working on a website that will allow students from my university to automatically generate valid schedules based on the courses they'd like to take. Before working on the site itself, I decided to tackle the issue of how to schedule…
Assil Ksiksi
  • 344
  • 1
  • 3
  • 13
15
votes
1 answer

Java Scheduling: Quartz vs Others? (ie. Obsidian)

I'm about to incorporate Quartz in one of our projects. While looking for a free UI to help us to monitor its execution state (jobs, etc.) we came across to this article: why-you-shouldnt-use-quartz The author says Quartz is complex even for simple…
Sebastian
  • 1,835
  • 3
  • 22
  • 34
15
votes
4 answers

How to schedule task for start of every hour

I'm developing a service that suppose to start of every hour repeating exactly on the hour (1:00PM, 2:00PM, 3:00PM, etc.). I tried following but it has one problem that for first time i have to run the program exactly at start of hour and then this…
ImranRazaKhan
  • 1,955
  • 5
  • 33
  • 74
14
votes
7 answers

PHP function that receive a cron string and return the next run timestamp

I need to develop a task system that should be able to work on servers that doesn't support crontab. I'm asking if there is any existing code that can take a cron string (e.g. '0 0,12 1 */2 *' and return the timestamp of the next scheduled run. If…
xun
  • 607
  • 2
  • 7
  • 10
14
votes
4 answers

Java: waiting on synchronized block, who goes first?

This question is inspired by this other question. If multiple threads are waiting on a synchronized block, and the lock becomes available, who goes first? Is it by thread priority (and then first-come-first-served)? And do the same rules apply for…
Thilo
  • 257,207
  • 101
  • 511
  • 656
14
votes
3 answers

How is pthread_join implemented?

I'm a little new to threading, so you'll have to forgive the naiveté of this question. How is pthread_join implemented and how does it effect thread scheduling? I always pictured pthread_join implemented with a while loop, simply causing the…
Tom
  • 18,685
  • 15
  • 71
  • 81
14
votes
10 answers

Finding Last Fired time using a Cron Expression in Java

Is there a way in Java to find the "Last Fired Time" from a Cron Expression? E.g. If now = 25-Apr-2010 10PM, and the cron expression is 0 15 10 ? * * (quartz), it should return 25-Apr-2010 10:15AM. Note: I do not care if we use standard cron…
a-sak
  • 1,320
  • 6
  • 21
  • 33
14
votes
6 answers

"Work stealing" vs. "Work shrugging"?

Why is it that I can find lots of information on "work stealing" and nothing on "work shrugging" as a dynamic load-balancing strategy? By "work-shrugging" I mean pushing surplus work away from busy processors onto less loaded neighbours, rather than…
14
votes
1 answer

Are there any cases where priority inheritance is not desirable?

I understand what priority inheritance is. I also understand, from the Mars Pathfinder's system reset issue, that most of the time, depending upon the criticality of the operation, it is good to enable/implement priority inheritance. However, are…
Anish Ramaswamy
  • 2,326
  • 3
  • 32
  • 63
14
votes
2 answers

Who schedules the scheduler in OS - Isn't it a chicken and egg scenario?

Who schedules the scheduler? Which is the first task created and how is this first task created? Isn't any resource or memory required for it? isn't like a chicken and egg scenario? Isn't scheduler a task? Does it get the CPU at the end of each time…
aks
  • 4,695
  • 8
  • 36
  • 37
14
votes
2 answers

Linux - threads and process scheduling priorities

if we create pthreads (pthread_create) or processes (fork) with default scheduling policies on linux, will the scheduler treats the processes and threads with same priority while scheduling them? let us say there is process P1 with one thread and…
Medicine
  • 1,923
  • 2
  • 23
  • 33