Questions tagged [preemption]
131 questions
3
votes
2 answers
C#, thread priorities, and locks
In C#, if a high priority task is ready to execute and another (low priority) thread is already inside a monitor, would the low priority task be preempted in the following two scenarios:
the higher priority task wants to acquire one (or more) locks…

user1258126
- 301
- 1
- 13
2
votes
3 answers
basic multithreading
I have the following Interview question:
class someClass
{
int sum=0;
public void foo()
{
for(int i=0; i<100; i++)
{
sum++
}
}
}
There are two parallel threads running through the foo method.
the…

mary
- 869
- 5
- 13
- 26
2
votes
2 answers
Snakemake: Job preemption can interrupt running jobs on clusters, how to make sure that the task is not considered as failed?
I'm using Snakemake on a cluster, and I don't know how best to handle the fact that some jobs can be preempted.
For more power on the cluster I use, it is possible to have access to the resources of other teams, but with the risk of being preempted,…

Thomas Bigot
- 21
- 2
2
votes
1 answer
kubernetes pending pod priority
I have the following pods on my kubernetes (1.18.3) cluster:
NAME READY STATUS RESTARTS AGE
pod1 1/1 Running 0 14m
pod2 1/1 Running 0 14m
pod3 0/1 Pending 0 14m
pod4 0/1 …

Zsolti Vagyok
- 55
- 1
- 6
2
votes
1 answer
Using podAntiAffinity rules to ensure pods run on different pre-emptible nodes
I have a 3-node cluster running on GKE. All the nodes are pre-emptible meaning they can be killed at any time and generally do not live longer than 24 hours. In the event a node is killed the autoscaler spins up a new node to replace it. This…

harryg
- 23,311
- 45
- 125
- 198
2
votes
1 answer
SLURM QOS Preemption
I was trying to setup a preemption in my SLURM 19.05 cluster, but I could not figure out how to make preemption work like what I planned.
Basically, I have two QOS.
$ sacctmgr show qos format=name,priority,preempt
Name Priority …

Woody
- 612
- 9
- 21
2
votes
0 answers
Undesired latency when kernel thread does more communication work
We have developed a kernel module that acts basically like a wired communication traffic (eth, ...) - WiFi bridge. It forwards periodically incoming wired data to WiFi and vice versa. The system consists of two devices running the same kernel…

user2818825
- 73
- 5
2
votes
1 answer
How to stop Pepper robot from preempting its tablet?
I'm trying to create a program, a part of which will transmit real-time video in frames (or in other words images) from my PC's webcam to Pepper's tablet using naoqi Python SDK. On the robot's side there will be a program using ALTabletService's…

androadi
- 25
- 7
2
votes
2 answers
Why kernel preemption is safe only when preempt_count == 0?
Linux kernel 2.6 introduced a new per-thread field---preempt_count---which is incremented/decremented whenever a lock is acquired/released. This field is used to allow kernel preemption: "If need_resched is set and preempt_count is zero, then a more…

Simple.guy
- 362
- 3
- 15
2
votes
0 answers
Huge Difference in magnitude of getCurrentThreadCpuTime diff and System.nanoTime() diff for a code snippet in Java
ThreadMXBean threadBean = ManagementFactory.getThreadMXBean();
long startCPUTime = threadBean.getCurrentThreadCpuTime();
long startTime = System.nanoTime();
// Some Java Code (No Network/Database calls) .....
long endCPUTime =…

insanely_sin
- 986
- 1
- 14
- 22
2
votes
3 answers
How to limit the execution time of a function in C/POSIX?
Similar to this question, I'd like to limit the execution time of a function--preferably with microsecond accuracy--in C. I imagine that C++ exceptions could be used to achieve a result similar to this Python solution. Though it's not ideal, such an…

troutwine
- 3,721
- 3
- 28
- 62
2
votes
2 answers
Context switches in control paths of a non-preemptive kernel (Linux)
The Linux kernel is non-preemptive, but I just read that there could be context-switches in different control paths. Doesn't that contradict the non-preemptive nature on the Linux kernel?

EpsilonVector
- 3,973
- 7
- 38
- 62
2
votes
2 answers
Can the scheduler or some critical kernel threads be preempted in a preemptible Linux kernel?
Can the scheduler or some critical kernel threads be preempted in a preemptible Linux kernel? What about in an interrupt handler (top half or bottom half)?

WindChaser
- 960
- 1
- 10
- 30
2
votes
1 answer
why spin_lock_irqsave needs to disable preemption on multiprocessor
Just curious why spin_lock_irqsave needs to disable the preemption after disabling local interrupt.
static inline unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock)
{
unsigned long flags;
local_irq_save(flags);
…

eric chen
- 21
- 3
2
votes
3 answers
C# controlling threads (resume/suspend)
I'm trying to simulate (very basic & simple) OS process manager subsystem, I have three "processes" (workers) writing something to console (this is an example):
public class Message
{
public Message() { }
public void Show()
…

Vladislav Bolshakov
- 191
- 14