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

Is it safe to use java.util.Timer inside a servlet ?

For many reasons, it is not good practice to use threads inside a servlet. java.util.Timer seems like wrapper around a thread. So, is it also not safe to use it? If so, what is the safest way to schedule a task in a servlet?
mebada
  • 2,252
  • 4
  • 27
  • 35
6
votes
2 answers

Algorithm to find best possible time slot for group of participants

What algorithm would you recommend i use to solve the following problem? I want to solve the problem of finding the best possible time slot which suits all (or nearly all) participants based on their calendar availability. I'm using Java and want to…
cdugga
  • 3,849
  • 17
  • 81
  • 127
6
votes
1 answer

How to increase CPU frequency of newly spawned process

I've been working on a hobby project for a while (written in C), and it's still far from complete. It's very important that it will be fast, so I recently decided to do some benchmarking to verify that my way of solving the problem wouldn't be…
torso
  • 61
  • 2
6
votes
1 answer

Tasks behaving incorrectly in round-robin schedule

I have FreeRTOS running on a STM32F4DISCOVERY board, and I have this code: xTaskCreate( vTask1, "Task 1", 200, NULL, 1, NULL ); xTaskCreate( vTask2, "Task 2", 200, NULL, 1, NULL ); vTaskStartScheduler(); where vTask1 is this function: void vTask1(…
0x5C91
  • 3,360
  • 3
  • 31
  • 46
6
votes
7 answers

University exam scheduling algorithm/problem

I wonder how to schedule 10k students to do exams in 2 weeks and guarantee no student will have an exam in two consecutive periods. I'm assuming some form of heuristics be applied. All we know : Number of students and the courses that they're each…
dassouki
  • 6,286
  • 7
  • 51
  • 81
6
votes
3 answers

Worker/Timeslot permutation/constraint filtering algorithm

Hope you can help me out with this guys. It's not help with work -- it's for a charity of very hard working volunteers, who could really use a less confusing/annoying timetable system than what they currently have. If anyone knows of a good…
Lee B
  • 2,137
  • 12
  • 16
6
votes
4 answers

Java EE 6 @Startup and @Schedule never being executed

I have the following singleton which should be executed when the web application starts but it does not, and the scheduled task does not run either. @Singleton @Startup public class Scheduler { private static int count = 0; @PostConstruct …
Paul Blundell
  • 1,857
  • 4
  • 22
  • 27
6
votes
2 answers

Schedule Searching in PHP/MySQL with templates and overrides

I'm looking for some advice/help on quite a complex search algorithm. Any articles to relevant techniques etc. would be much appreciated. Background I'm building an application, which, in a nutshell, allows users to set their "availability" for any…
Darren Taylor
  • 1,975
  • 14
  • 18
6
votes
1 answer

Quartz.net repeat job at interval after job is completed

I am currently implementing Quartz.net in a simple application that should execute a piece of code every (for example) 5 seconds. Only now the code sometimes takes more than 5 seconds to complete. At first I had the problem that the code was…
Wim Haanstra
  • 5,918
  • 5
  • 41
  • 57
6
votes
2 answers

How to keep parent and child process on same core

I understand that a process (parent) can be pinned to a core using sched_setaffinity and then the forked process inherits the affinity and would also be pinned on the same core. However, I don't want to keep them pinned together to the same core…
ngupta
  • 121
  • 1
  • 6
6
votes
1 answer

Can I change the priority of a process in Erlang?

I understand from here http://cs.ucsb.edu/~puneet/reports/erlang.pdf (section 4.4) that Process Scheduling in Erlang is based on 4 different queues - with one designated as 'highest priority'. I have an Erlang program and I'd like to assign one…
Lee
  • 29,398
  • 28
  • 117
  • 170
6
votes
4 answers

Optimal sequence of non-overlapping purchases

I think this is a scheduling problem, but I'm not even sure on that much! What I want is to find the optimal sequence of non-overlapping purchase decisions, when I have full knowledge of their value and what opportunities are coming up in the…
Darren Cook
  • 27,837
  • 13
  • 117
  • 217
6
votes
1 answer

Scheduling reservations (not restaurant) with python

I'm writing a python application that uses OpenStack to provide students access to a limited number of virtual machines. Students can place reservations, either now or in the future. I need to limit the number of virtual machines scheduled at any…
curtis
  • 95
  • 1
  • 8
6
votes
1 answer

Autosys R11 job dependency with dependent-job run-time condition

In Autosys R11, I need job_b to run only if job_a succeeded within the last X hours. Apparently, R11 allows you to "set look back dependencies on job_a to only run if job_c has ran to S within X hours." What would be the syntax? s(job_a) What would…
anomal
  • 2,249
  • 2
  • 19
  • 17
6
votes
3 answers

Concurrency of posix threads in multiprocessor machine

I have some doubts regarding concurrency of posix threads in multiprocessor machine. I have found similar questions in SO regarding it but didnt find conclusive answer. Below is my understanding. I want to know if i am correct. Posix threads are…
hackrock
  • 317
  • 1
  • 4
  • 13