Questions tagged [context-switching]

62 questions
0
votes
0 answers

Which is more costly in terms of performance: a few threads with many context switches or many threads with few context switches?

Which is more costly in terms of performance: a few threads with many context switches or many threads with few context switches? Assuming that the CPU can process one thread at a time: In Case 1 with 3 threads and 300 context switches, each thread…
nnv98
  • 1
  • 1
0
votes
0 answers

How to stop another thread switching the context

I am working on a Micronaut Application. In this application, there is a main scheduled job which works like a workflow engine and multiple steps process the data which is around 600K records. Along with this scheduled job, we have an event listener…
Manish
  • 1,274
  • 3
  • 22
  • 59
0
votes
0 answers

How to make TaskSwitchHookAdd execution work in VxWorks

I am seeing an issue on program that is running on embedded board on VxWorks platform. Problem description: A user space Task A with priority of 150 -> adds the TaskSwitchHookAdd((FUNCPTR) monitor_TaskA) to validate object states within TaskA via…
0
votes
2 answers

Does the context switch retain (keep state of variables) the value of the variables when it resumes the task?

Pseudocode (Assuming that there is no synchronization of any kind): count = 0; // Global Thread 1: count = count + 1; suppose that after reading count "captured" the 0 and context switch occurred. It went to another thread and the following…
user19481364
0
votes
0 answers

cortex m3 and m4 stack creation for context switching

i'm reading the definitive guide to ARM cortex-M3 and cortex-M4, i've reached the part where he explains the author explains the how the PendSV works, i'm stuck at the stack creation in the example at context switching in actio nsection page 340,…
camelkos
  • 51
  • 5
0
votes
2 answers

Can anyone explain this assembly code for the "stack" point of view?

Can anyone explain the arm based assembly code for the stack point of view ; specifically the stack view for "reset_handler" right before calling "main", "save_context" and "resume" part? (Note that I know what the code is doing but I can't…
0
votes
1 answer

Saving the value of registers during context switch

During Context Switching, the kernel saves the state of current process (process1) and restores the state of the other process (process2) into CPU (loads the various registers with the previous values for process2). Which memory area the kernel…
SRaj
  • 1,168
  • 1
  • 14
  • 36
0
votes
2 answers

Do we need to handle weak reference and context switching?

To mitigate memory leaks we keep a weak reference of an activity in an inner class running on different thread. We check weakreference.get() is non null and then only proceed further. What if when we checked weakreference.get() was non null but…
0
votes
0 answers

How does the Windows dispatcher load the next process to run on CPU?

There is not a lot of details available online for this question but was hoping that someone out there might have a clue. I know that its the job of the scheduler to determine (select) the next process to run but how does dispatcher find out ?
David J
  • 15
  • 4
0
votes
0 answers

Is context switching is the only factor that affects the bounded waiting in process synchronization?

Are there any other factors that affect the property of bounded waiting in process synchronization other than context switching?
0
votes
0 answers

ASP.NET MVC thread context switching overhead

I would like to know if an asynchronous implementation like the one I will show below generates a context switch problem. public async Task Get() { var data = await GetDataAsync(); return data; } public async Task
0
votes
1 answer

Why the arm port of Linux kernel did not backup the "cpsr" register during the context switch?

The switch to assembly of arm32 in linux is like that: you coud see there are no cpsr reigister backup, compare to others arch, like mips or riscv, which corresponding mstatus and status register are all do the backup and restore during the…
0
votes
1 answer

Does OS save memory values in context switch?

I have a question about which datas will be saved in context switching. I have searched but all links just talked about registers. My question is does os also save the memory values of a process ? Assume a process has defined an array starting…
0
votes
1 answer

Performance in Oracle insert to table from select with function calls

I am writing a query to calculate some values and save them onto a table on a periodic basis. The values I needs are being returned from a function call. These values need to be saved on to a table, and I have a dbms schedule job to insert these to…
Dee
  • 199
  • 4
  • 17
0
votes
1 answer

Context Switching to Specific Process after Specific ISR

Is there any (dirty)method to provoke context switching to specific process after specific ISR? In normal situation, after an ISR, the process which was interrupted will keep running, and I have to wait the scheduler to pick that specific process. I…