scheduling

CRON jobs in php deployed in windows platform

让人想犯罪 __ 提交于 2020-01-17 07:50:08
问题 How to run a scheduled job scripted in php using windows? I'm using Windows XP sp3. 回答1: Use at or the task scheduler. How To Use the AT Command to Schedule Tasks (seems to require login now - wtf?) Alternative: Wikipedia on AT How To Schedule Tasks in Windows XP You would have to call the PHP interpreter from the command line. In Windows, it is called php.exe . You'll have to find out where it resides, usually in the Programs folder or a sub-directory of your server installation. The command

Issue with Lock Ordering or Scheduling

旧街凉风 提交于 2020-01-16 08:59:19
问题 I have a C application that uses pthreads. There is a lock contention between two threads(say A and B) where A gets the lock first while B is waiting for the lock, Once A is done and releases the lock, B still doesn't get it and after a while A gets the lock again(A does acquire and release in a loop). If I attach my process to gdb and pause thread A after it has given up the lock and manually continue on thread B, it then gets it and does what is needed. This does not look like a dead lock

Non preemptive Earliest deadline first scheduling

你。 提交于 2020-01-16 02:08:32
问题 I am working on a task scheduler and I would like to use EDF scheduling. The task set I need to schedule contains only tasks with deadlines equal to their periods and the tasks must be scheduled periodically. The problem I have is that the tasks cannot be interrupted once they have started execution. I know that the EDF is an optimal scheduling algorithm only when when tasks are scheduled on a single processor preemptively so I was wondering if there might be any tests or constraints I might

How do I configure a custom trigger in Spring 3?

笑着哭i 提交于 2020-01-15 07:46:06
问题 I need to configure a scheduling algorithm that is beyond the capabilities of Spring's in-build scheduling (basically "every 5 minutes, but only between 4:00h and 16:00h"). It seems that implementing the org.springframework.scheduling.Trigger interface is the way to go, which seems simple enough. The part I can't figure out and that doesn't seem to be answered in the documentation is: how does this mix with the XML configuration? There doesn't seem to be any way of specifying a custom trigger

Algorithm: Selecting pairs of teams from a set of games

笑着哭i 提交于 2020-01-14 19:51:11
问题 I'm trying to create a scheduler for a sports league and I'd like to schedule the teams in groups so every team gets one game per group. I think the thing I'm trying to do is an existing problem in computer science, but I don't know what it's called and I'm having trouble finding information about it. Either way, here's the situation: Let's say I have a set of teams A = {1,2,3,...,n} and a set of pairs of those teams B = {(1,2), (1,3), (2,4), (6,9),...} . B does not have every possible

IHostedService/BackgroundService to run on a schedule (as opposed to Task.Delay)

我是研究僧i 提交于 2020-01-14 19:17:07
问题 Microsoft's example for a forever/continous IHostedService at Implement background tasks in microservices with IHostedService and the BackgroundService class uses while + Task.Delay 'pattern'. This illustrated with a code snippet that a simplified version is just below. public class GracePeriodManagerService : BackgroundService (...) protected override async Task ExecuteAsync(CancellationToken stoppingToken) { while (!stoppingToken.IsCancellationRequested) { //Do work await Task.Delay

How to close a Dialog after certain seconds of inactivity?

依然范特西╮ 提交于 2020-01-13 11:29:08
问题 i have an app that contains a dialog i want to close this dialog after x second, when user haven't any interact with app, like volume seekbar popup(that's open when the volume button clicked, and closed after 2 second of inactivity). what is the simplest way to implement this? thank you 回答1: You could for example use a Handler and call its .removeCallbacks() and .postDelayed() method everytime the user interacts with the dialog. Upon an interaction, the .removeCallbacks() method will cancel

Schedule and execute a PHP script automatically

冷暖自知 提交于 2020-01-13 09:49:51
问题 I have written a PHP script which generates an SQL file containing all tables in my database. What I want to do is execute this script daily or every n days. I have read about cron jobs but I am using Windows. How can I automate the script execution on the server? 回答1: You'll need to add a scheduled task to call the URL. First of all, read up here: MS KB - this is for Windows XP. Second, you'll need some way to call the URL - i'd recommend using something like wget - this way you can call the

Constantly monitor a program/process using Python

与世无争的帅哥 提交于 2020-01-12 07:37:06
问题 I am trying to constantly monitor a process which is basically a Python program. If the program stops, then I have to start the program again. I am using another Python program to do so. For example, say I have to constantly run a process called run_constantly.py . I initially run this program manually, which writes its process ID to the file "PID" (in the location out/PROCESSID/PID). Now I run another program which has the following code to monitor the program run_constantly.py from a Linux

Calling a function every 10 minutes

我们两清 提交于 2020-01-09 07:05:16
问题 I'm not an expert, just a beginner. So I kindly ask that you write some code for me. If I have two classes, CLASS A and CLASS B , and inside CLASS B there is a function called funb() . I want to call this function from CLASS A every ten minutes. You have already given me some ideas, however I didn't quite understand. Can you post some example code, please? 回答1: Have a look at the ScheduledExecutorService: Here is a class with a method that sets up a ScheduledExecutorService to beep every ten