scheduling

Java scheduled executor accuracy

大兔子大兔子 提交于 2019-12-03 11:52:51
There is a peculiarity that I encountered while using Java scheduled executors and was wondering if what I experienced is normal. I need to schedule tasks that execute at a predefined rate of 5 seconds. It is expected that these tasks will take longer than 5 seconds to execute from time to time, but when the time to run them goes below 5 seconds, the backed up list of tasks should run in quick succession to catch up. When running the tasks, it is important to know what the original scheduled execution time was (think scheduledExecutionTime() in java.util.TimerTask ). Finally, I need to track

How have you implemented SCRUM for working alone? [closed]

余生长醉 提交于 2019-12-03 10:20:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I am working alone at the beginning of a sizable open source project and would like to leverage some of the core ideas/methods from Scrum to help manage my time and remain focused on development and deploying early, demonstrable functionality. I would like to hear from others who have used Scrum alone and what

get current->pid while in interrupt

半腔热情 提交于 2019-12-03 09:03:29
I'm writing something on the linux scheduler and I need to know which process was running before my interrupt came in.. is the current structure available? If I do current->pid while in the interrupt handler, do I get the pid of the process I interrupted? You can, current->pid exists and is the process that was interrupted (may be the idle thread, or any). If you're writing inside the Linux scheduler, you should be very careful. current is changed by the scheduler as it chooses a new process to run, so its value depends on when exactly you read it. I wouldn't expect current to be valid outside

Scheduling Employees - what data structure to use?

强颜欢笑 提交于 2019-12-03 08:17:33
问题 Question I'm trying to write a simple employee Scheduling software for about 10-20 people in my software development company. After some consideration I settled on writing a web app in Python, Ruby or PHP + Postgres/MySQL DB. While designing database models I began to wonder what data structure would actually be the best for that kind of application. What it will look like Example of app showing the month view would be similar to this: OCTOBER 1 2 3 4 5 6 7 8 9 ... John Apple M M A A N N O O

pthreads with real time priority

左心房为你撑大大i 提交于 2019-12-03 07:55:46
I need to manage a pool of threads having different priorities, so I wrote the following thread startup procedure: static int startup(thrd_t *thrd, thrd_sync_t *sync, int prio) { pthread_attr_t attr; int err; struct sched_param param = { .sched_priority = prio }; assert(pthread_attr_init(&attr) == 0); assert(pthread_attr_setschedpolicy(&attr, SCHED_FIFO) == 0); assert(pthread_attr_setschedparam(&attr, &param) == 0); err = pthread_create(&thrd->handler, &attr, thread_routine, (void *)thrd); pthread_attr_destroy(&attr); return err; } In principle the unprivileged user should not be allowed to

How to stop a task in ScheduledThreadPoolExecutor once I think it's completed

て烟熏妆下的殇ゞ 提交于 2019-12-03 07:48:24
问题 I have a ScheduledThreadPoolExecutor with which I schedule a task to run at a fixed rate. I want the task to be running with a specified delay for a maximum of say 10 times until it "succeeds". After that, I will not want the task to be retried. So basically I'll need to stop running the scheduled task when I want it to be stopped, but without shutting down the ScheduledThreadPoolExecutor. Any idea how I'd do that? Here's some pseudocode - public class ScheduledThreadPoolExecutorTest { public

How to run processes piped with bash on multiple cores?

不羁岁月 提交于 2019-12-03 05:59:21
问题 I have a simple bash script that pipes output of one process to another. Namely:. dostuff | filterstuff It happens that on my Linux system (openSUSE if it matters, kernel 2.6.27) these both processes run on a single core. However, running different processes on different cores is a default policy that doesn't happen to trigger in this case. What component of the system is responsible for that and what should I do to utilize multicore feature? Note that there's no such problem on 2.6.30 kernel

Heuristic algorithm for load balancing among threads

五迷三道 提交于 2019-12-03 05:18:14
问题 I'm working on a multi-threaded program where I have a number of worker threads performing tasks of unequal length. I want to load-balance the tasks to ensure that they do roughly the same amount of work. For each task T i I have a number c i which provides a good approximation to the amount of work that is required for that task. I'm looking for an efficient (O(N) N = number of tasks or better) algorithm which will give me "roughly" a good load balance given the values of c i . It doesn't

Job queue optimization algorithms

我只是一个虾纸丫 提交于 2019-12-03 05:16:00
问题 We have an application that requires assignment of jobs to resources. The resources have a number of attributes that define their suitability to a particular job -- some are preferences, some are hard constraints (all of the membership variety, e.g. "resource A is suited to jobs with color X, Y, or Z". Resources have a cost associated with them (the duration they spend on-line). We have the ability to recruit resources -- this takes a variable amount of time. We can recruit for a fixed

What context does the scheduler code run in?

女生的网名这么多〃 提交于 2019-12-03 04:32:35
问题 There are two cases where the scheduler code schedule() is invoked- When a process voluntarily calls schedule() Timer interrupt calls schedule() In case 2, I think schedule() runs in interrupt context, but what about the first case? Does it run in the context of the process which invoked it? Also are there any more scenarios which invoke schedule() ? 回答1: schedule() always runs in process context. In the second case, when it is initiated by a timer interrupt, it is in the return path back