scheduling

How can crontab print messages in console?

拥有回忆 提交于 2019-12-25 01:45:37
问题 Hi I am really new in Linux:D I made a crontab program which is supposed to print current time in console every 3 minutes. What I did is below. I made a crontab. In terminal, command " crontab -e " and add a phrase " */3 * * * * /home/user/a.out " a.out is a result file of " gcc WowCron.c ". Code is below. int main (int argc, char* argv[]){ time_t now; time(&now); printf("this is what we call cron does: %s\n", ctime(&now)); return 0; } and it works wonderfully when run individually. Then I

SWI Prolog CLP(FD) scheduling

巧了我就是萌 提交于 2019-12-24 13:26:32
问题 I am solving a scheduling task in SWI Prolog using the CLPFD library. Since it is the first time I solve something more serious than was the sendmory I probably need some good advices from more experienced users. Let me briefly describe the domain/the task. Domain I have a "calendar" for a month. Everyday there are 2 for the whole day, 2 for the whole night (long 12h service). There are also, only Mon-Fri 10 more workers for 8 hours (short service). The domain constraints are, obviously:

Schedule Quartz.NET trigger that executes once a week

邮差的信 提交于 2019-12-24 11:26:30
问题 I need to schedule Quartz.NET trigger so that it fires on every Monday at 09.00. So, I tried to use some features as below but I think it does not true as the parameters are not logical (It worked for daily scheduling, but after change to this it does not). So, could you please give an example that executes job weekly? ITrigger trigger = TriggerBuilder.Create() .WithDailyTimeIntervalSchedule (s => s.WithInterval(1, IntervalUnit.Week) .OnDaysOfTheWeek(DayOfWeek.Monday) .StartingDailyAt

nptl SIGCONT and thread scheduling

眉间皱痕 提交于 2019-12-24 01:16:28
问题 I'm trying to port a code that relies on SIGCONT to stop certain threads of an application. With current linux nptl implementation seems one can't rely on that in 2.6.x kernels. I'm trying to devise a method to stop other threads. Currently I can only think on mutexes and condition variables. Any hints is appreciated. 回答1: If you are relying on stopping and resuming other threads, then your application will eventually fail. That is because, you cannot guarantee that you're not going to stop a

Forcing a context switch from the userland on Linux?

╄→尐↘猪︶ㄣ 提交于 2019-12-23 21:33:30
问题 Is it possible to advice the kernel to perform an immediate context switch to a different thread, bypassing the scheduler logic? For example, if I've just created a thread/process with clone and I want to begin its execution straight away, renouncing the current context immediately, instead of waiting for the next time the kernel reschedules stuff. Ideally, I'm looking for something identical to the thread_switch call on the Mach kernel. 回答1: You shouldn't be trying to control context

Looking for solution based on ThreadPoolExecutor to ensure sequential execution of tasks

二次信任 提交于 2019-12-23 20:00:31
问题 I have a thread pool of m threads. Let's say m were 10 and fix. Then there are n queues with the possibility of n becoming large (like 100'000 or more). Every queue holds tasks to be executed by those m threads. Now, very important, every queue must be worked off sequentially task by task. This is a requirement to make sure that tasks are executed in the order they were added to the queue. Otherwise the data could become inconsistent (same as, say, with JMS queues). So the question is now how

Checking if periodic ScheduledFuture is running now

混江龙づ霸主 提交于 2019-12-23 19:18:12
问题 I have a periodic task scheduled via Spring TaskScheduler.schedule(Runnable, Trigger) . Given the returned ScheduledFuture , is there any way to check, if the task is running at current moment? 回答1: You can change you Runnable like this: class Runner implements Runnable{ public volatile boolean RUNNING = false; public void run(){ RUNNING = true; try{ // Your code } finally { RUNNING = false; } } } edit Thought operations with boolean are atomic and don't need to be volatile. 回答2: After a bit

How to mix genetic algorithm with some heuristic

試著忘記壹切 提交于 2019-12-23 12:20:07
问题 I'm working on university scheduling problem and using simple genetic algorithm for this. Actually it works great and optimizes the objective function value for 1 hour from 0% to 90% (approx). But then the process getting slow down drammatically and it takes days to get the best solution. I saw a lot of papers that it is reasonable to mix other algos with genetiс one. Could you, please, give me some piece of advise of what algorithm can be mixed with genetic one and of how this algorithm can

What is difference between sched_batch and sched_other scheduling?

ε祈祈猫儿з 提交于 2019-12-23 07:27:31
问题 I am working on Ubuntu project. Have not found clear difference between sched_batch and sched_other. Can anyone tell me the difference? 回答1: Threads that are scheduled with sched_batch are assumed to be non-interactive, but CPU bound and optimized for throughput. Thus, this policy is more cache-friendly. The default sched_batch timeslice is 1.5 seconds. In addition, in case of SMP, sched_batch will migrate to a core with high idleness (with respect to non-batch threads). 回答2: The primary

How do you Make the H in Jenkins Poll SCM Schedule actually random

橙三吉。 提交于 2019-12-23 04:54:15
问题 I running Jenkins 1.565.1 The docs indicate the H (hash) function to be a random hash of the project name. This does not appear to be true in my case. I set SCM polling to be every 4 hours H H/4 * * * for a number of projects and they get scheduled at 12:00:31 12:00:58 12:00:23 12:00:14 This does not appear to be random at all! Ho do I start them at a random time, and check back every 4 hours. If I change the formula to H H/3 * * * or H H * * * It still has the same starting time, within the