scheduling

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

混江龙づ霸主 提交于 2019-11-29 04:08:56
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 System.Threading.Timer is not using system clock resolution - it keeps the ~ 15ms resolution. Despite

Provide time zone to Spring @Scheduled?

时间秒杀一切 提交于 2019-11-29 02:49:17
How can I configure the time zone for a Spring based @Scheduled cron job? Background: I have a job that executes once a day, say 2 PM, using Spring's @Scheduled annotation: @Scheduled(cron = "0 0 14 * * *") public void execute() { // do scheduled job } The problem is that 2 PM differs between different servers, because Spring uses on TimeZone.getDefault() internally . Moreover, the JavaDoc of TimeZone.getDefault() states that: Gets the default TimeZone for this host. The source of the default TimeZone may vary with implementation. In other words, the time zone is not determined. It may depend

Enabling mysql Event scheduler on server restarts

送分小仙女□ 提交于 2019-11-29 02:38:12
I am running phpmyadmin and installed apache server on my personal computer. My problem is that I am trying to set MySQL event_scheduler to always be enabled even when the server restarts. I was reading that by setting the following command line in the server configuration file ( my.cnf or my.ini ) it should work: event_scheduler=DISABLED . However, where do I locate this my.cnf or my.ini file, and also should the command line be event_scheduler=DISABLED or event_scheduler=ENABLED seeing that I want it to always be enabled? You should set 'ON' value (not ENABLED). In the configuration file in

How can I schedule tasks in a WinForms app?

流过昼夜 提交于 2019-11-29 02:26:23
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 to be able to let the user select how often to schedule the sync (e.g. hourly, daily - pick time, etc)

SQL Server Agent Job Timeout

旧巷老猫 提交于 2019-11-29 01:34:26
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 a timeout for a job. Does anyone know the way to do it? Thanks We do something like the code below as part of a nightly job processing subsystem - it is more complicated than this actually in reality; for example we are processing multiple interdependent sets of jobs, and read in job names and timeout values from configuration tables - but this

Controlling scheduling priority of python threads?

一曲冷凌霜 提交于 2019-11-29 01:23:40
I've written a script that uses two thread pools of ten threads each to pull in data from an API. The thread pool implements this code on ActiveState . Each thread pool is monitoring a Redis database via PubSub for new entries. When a new entry is published, python passes the data to a function that uses python's Subprocess.POpen to execute a PHP shell to do the actual work of calling the API. This system of launching PHP shells is necessary for functionality with my PHP web app, so launching PHP shells with Python can't be avoided. This script will only be running on Linux servers. How do I

How keep NSTimer when application entering background?

冷暖自知 提交于 2019-11-28 23:53:08
I'm here because a didn't find any solutions for my issue :( I'm doing an simple application in which i have to send (by socket) some informations to a server (like GPS l/L, accuracy, Battery level, etc). The current code works fine when application is in foreground. myTimer = [NSTimer scheduledTimerWithTimeInterval: 2.0 target:self selector: @selector(sendPosToServer:) userInfo:nil repeats: YES]; myTimer2 = [NSTimer scheduledTimerWithTimeInterval: 3.0 target:self selector: @selector(sendBatteryToServer:) userInfo:nil repeats: YES]; myTimer3 = [NSTimer scheduledTimerWithTimeInterval: 5.0

Pros and cons of using java.util.timer vs Quartz for scheduling? [closed]

寵の児 提交于 2019-11-28 23:16:28
问题 I've got to write an app that performs a series of tasks: task to be run once at 0200 hours every day. task to be run once at 0400 hours ever day task to be run at 15 minute intervals starting at 0003 hours task to be run at 15 minute intervals starting at 0005 hours What are the pros and cons of using plain java.util.timer Vs. Quartz for this? Are there any other alternatives I should be considering? 回答1: Quartz Additional dependency API currently (late 2011) changing: 1.x on its way out,

What is the best way to schedule a sending-email task with Ruby on Rails?

北城余情 提交于 2019-11-28 23:13:42
问题 I would like to schedule a daily task : every day at 7 AM, I want an email to be sent (without human intervention). I'm working on the RoR framework and I'm wondering what is the best way to do that? I've heard about BackgrounDRB, OpenWFEru scheduler or things based on Cron, but I'm a newbie and don't understand which one is made for my need. 回答1: Another option is to create a rake task that is run by a cron job. To do this, create a file some_file.rake and put it in your lib/tasks folder.

Scheduled jobs in ASP.NET website without buying dedicated servers

拜拜、爱过 提交于 2019-11-28 22:09:19
How can I perform various task (such as email alert/sending news letter) on a configured schedule time on a shared hosting server? Here's a Global.ascx.cs file I've used to do this sort of thing in the past, using cache expiry to trigger the scheduled task: public class Global : HttpApplication { private const string CACHE_ENTRY_KEY = "ServiceMimicCacheEntry"; private const string CACHE_KEY = "ServiceMimicCache"; private void Application_Start(object sender, EventArgs e) { Application[CACHE_KEY] = HttpContext.Current.Cache; RegisterCacheEntry(); } private void RegisterCacheEntry() { Cache