scheduling

Spring Scheduling: @Scheduled vs Quartz

你离开我真会死。 提交于 2019-11-28 20:37:46
问题 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 on the docs, Spring provides three way of scheduling: @Scheduled Via Quartz Via JDK Timer I have no interest in the JDK Timer. Why should I choose @Scheduled over Quartz? (When I mention Quartz I mean using Spring's bean wrapper for Quartz). Let's

Are all scheduling problems NP-Hard?

隐身守侯 提交于 2019-11-28 20:32:21
I know there are some scheduling problems out there that are NP-hard/NP-complete ... however, none of them are stated in such a way to show this situation is also NP. If you have a set of tasks constrained to a startAfter , startBy , and duration all trying to use a single resource ... can you resolve a schedule or identify that it cannot be resolved without an exhaustive search? If the answer is "sorry pal, but this is NP-complete" what would be the best heuristic(s?) to use and are there ways to decrease the time it takes to a) resolve a schedule and b) to identify an unresolvable schedule.

Efficient scheduling of university courses

妖精的绣舞 提交于 2019-11-28 18:02:17
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 the courses efficiently. A few clarifications: Each course at our university (and I assume at every other university) comprises of one or more sections. So, for instance, Calculus I currently has 4 sections available. This means that, depending on the amount of sections, and whether or not the course has a lab, this drastically affects the scheduling

Linux SCHED_OTHER, SCHED_FIFO and SCHED_RR - differences

烈酒焚心 提交于 2019-11-28 17:52:49
Can someone explain the differences between SCHED_OTHER, SCHED_FIFO and SCHED_RR? Thanks SCHED_FIFO and SCHED_RR are so called "real-time" policies. They implement the fixed-priority real-time scheduling specified by the POSIX standard. Tasks with these policies preempt every other task, which can thus easily go into starvation (if they don't release the CPU). The difference between SCHED_FIFO and SCHED_RR is that among tasks with the same priority, SCHED_RR performs a round-robin with a certain timeslice; SCHED_FIFO, instead, needs the task to explicitly yield the processor. SCHED_OTHER is

Tennis match scheduling

给你一囗甜甜゛ 提交于 2019-11-28 16:39:49
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 schedule that takes as few rounds as possible. (Because of the rule that there must a break between rounds for everyone, there can be a round without matches.) The output for 5 players and 2 courts could be: | 1 2 3 4 5 -|------------------- 2| 1 - 3| 5 3 - 4| 7 9 1 - 5| 3 7 9 5 - In this output the columns and rows are the player-numbers, and the

How does the OS scheduler regain control of CPU?

不打扰是莪最后的温柔 提交于 2019-11-28 15:52:48
I recently started to learn how the CPU and the operating system works, and I am bit confused about the operation of a single-CPU machine with an operating system that provides multitasking. As such, supposing my machine has a single CPU, this would mean that, at any given time, only one process could be running. Now, I can only assume that the scheduler used by the operating system to control the access to the precious CPU time is also a process. Thus, in this machine, either the user process or the scheduling system process is running at any given point in time, but not both. So here's a

A priority queue which allows efficient priority update?

自古美人都是妖i 提交于 2019-11-28 15:13:16
问题 UPDATE : Here's my implementation of Hashed Timing Wheels. Please let me know if you have an idea to improve the performance and concurrency. (20-Jan-2009) // Sample usage: public static void main(String[] args) throws Exception { Timer timer = new HashedWheelTimer(); for (int i = 0; i < 100000; i ++) { timer.newTimeout(new TimerTask() { public void run(Timeout timeout) throws Exception { // Extend another second. timeout.extend(); } }, 1000, TimeUnit.MILLISECONDS); } } UPDATE : I solved this

Selecting a Linux I/O Scheduler

混江龙づ霸主 提交于 2019-11-28 15:06:43
I read that it's supposedly possible to change the I/O scheduler for a particular device on a running kernel by writing to /sys/block/[disk]/queue/scheduler. For example I can see on my system: anon@anon:~$ cat /sys/block/sda/queue/scheduler noop anticipatory deadline [cfq] that the default is the completely fair queuing scheduler. What I'm wondering is if there is any use in including all four schedulers in my custom kernel. It would seem that there's not much point in having more than one scheduler compiled in unless the kernel is smart enough to select the correct scheduler for the correct

Service times directly proportional to number of threads

◇◆丶佛笑我妖孽 提交于 2019-11-28 14:29:38
My system is i5-Dual core with hyper-threading. Windows show me 4 processors. When i run a single optimized cpu-bound task by a single thread at a time its service time always display arround 35ms. But when i handover 2 tasks to 2 threads simultanously their service times display arround 70ms. I want to ask that my system have 4 processors then why does service times are arround 70 in case of 2 threads running teir tasks whereas 2 threads should run on 2 processors without any scheduling overhead.The codes are as follows. CPU-Bound Task is as follows. import java.math.BigInteger; public class

Setting up a scheduled task in .Net

谁都会走 提交于 2019-11-28 12:20:36
I've read a few posts here on StackOverflow about task scheduling, but I'm not sure that I get it right. I'm coding (in VB.Net) a backup application, that I'd like to add as a scheduled task (in fact, I'd just like to let the user decide to run it every day at, for example, 3 AM). I've read posts suggesting to use a windows service for this, but it sounds a bit to much for something as simple as periodically running a task, isn't it? Could you please advise me on how to simply set a scheduled task in VB.Net? I'm trying to keep my code as lightweight as possible. The best thing is to not write