scheduling

Is it possible to use Windows 7 Task scheduler in own application

左心房为你撑大大i 提交于 2019-11-28 02:01:10
问题 I'm developing add-on based application. Every add-on use scheduler. Loaded add-on schedule task. My application run only one instance. Sometimes application closed, sometimes running. Therefore i need to use Windows 7 Task scheduler How to use task scheduler on own application? I need create new task from application I need that when task finish, Send message to my application or invoke any function of my application Is it possible? How to do it? 回答1: Check out this project at CodeProject. A

Can I prevent a Linux user space pthread yielding in critical code?

十年热恋 提交于 2019-11-28 01:01:07
问题 I am working on an user space app for an embedded Linux project using the 2.6.24.3 kernel. My app passes data between two file nodes by creating 2 pthreads that each sleep until a asynchronous IO operation completes at which point it wakes and runs a completion handler. The completion handlers need to keep track of how many transfers are pending and maintain a handful of linked lists that one thread will add to and the other will remove. // sleep here until events arrive or time out expires

Java: waiting on synchronized block, who goes first?

 ̄綄美尐妖づ 提交于 2019-11-27 23:39:01
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 notify (with multiple wait ing threads)? According to this guy: http://tutorials.jenkov.com/java-concurrency/starvation-and-fairness.html Java issues no guarantees about the sequence. So I guess it is not based on thread priority I'll try to look further for an explanation on how Java actually decides who goes first. Someone else mentioned the

Timed Tasks (cron-like) in PHP

跟風遠走 提交于 2019-11-27 22:17:17
Is there a full featured, job scheduling package available for PHP? I'm looking for the PHP equivalent to Java's Quartz . I'm fine having things triggered externally from cron to drive the system. The functionality I'd be looking for: Ability to register task (class/method) to be called at given intervals. Ability to specify whether a given task can be run multiple times (potentially long running methods should not be run multiple times in certain cases). All registered entries/methods could be run in parallel (jobs are backgrounded so that they do not block other timed tasks). Ability to set

How can I schedule tasks in a WinForms app?

爷,独闯天下 提交于 2019-11-27 21:55:15
问题 QUESTION: How can I schedule tasks in a WinForms app? That is either (a) what is the best approach / .NET classes/methods to use of (b) if there is an open source component that does this well which one would be recommended. BACKGROUND: Winforms app (.NET v3.5, C#, VS2008) I'm assuming I will run the winforms application always, and just minimise to the system tray when not in use Want a simple approach (didn't want to get into separate service running that UI winforms app talks to etc) Want

Are all scheduling problems NP-Hard?

你。 提交于 2019-11-27 20:44:35
问题 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

Does linux schedule a process or a thread?

折月煮酒 提交于 2019-11-27 18:34:19
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 differentiated inside kernel how a scheduler treats them? How quantum for each thread is decided? a. If a quantum of time (say 100us) is decided for a process is that getting shared between all the threads of the process? or b. A quantum for each thread is decided by the scheduler? Note: Questions 1 and 2 are related and may look the same but just wanted

System.Threading.Timer vs System.Threading.Thread.Sleep resolution - .NET Timer not using system clock resolution

为君一笑 提交于 2019-11-27 18:06:59
问题 Questions: Why is the System.Threading.Timer keeping the 15ms resolution despite the OS clock resolution is much more precise? What is the recommendable way to achieve 1ms timing events resolution without busy CPU waiting? To stress once more: System timer has 1ms resolution in my case (as opposed to the question suggested as duplicate). So this is not an issue of system timer resolution. Therefore, there is no useful info in the supposedly duplicate question. Background: It seems that .NET

Quartz Java resuming a job excecutes it many times

二次信任 提交于 2019-11-27 17:32:28
For my application i create jobs and schedule them with CronTriggers. Each job has only one trigger and both the job name and the trigger names are the same. No jobs share a trigger. Now when i create a cron trigger like this "0/1 * * * * ?" which instructs the job to execute every second, it works just fine. The problem rises when i first pause the job by calling : scheduler.pauseJob(jobName, jobGroup); and then resuming the job after let's say 50 seconds with : scheduler.resumeJob(jobName, jobGroup); What i see is that for these 50 seconds the job did not execute as requested. But the moment

How to stop a Runnable scheduled for repeated execution after a certain number of executions

北城余情 提交于 2019-11-27 17:29:49
Situation I have a Runnable. I have a class that schedules this Runnable for execution using a ScheduledExecutorService with scheduleWithFixedDelay . Goal I want to alter this class to schedule the Runnable for fixed delay execution either indefinitely, or until it has been run a certain number of times, depending on some parameter that is passed in to the constructor. If possible, I would like to use the same Runnable, as it is conceptually the same thing that should be "run". Possible approaches Approach #1 Have two Runnables, one that cancels the schedule after a number of executions (which