Skip to main content

Questions tagged [multi-tasking]

Questions about techniques for making multiple independent tasks (processes or threads) appear to execute concurrently, either by quickly context switching from one task to the next on a single processor, or by really executing the tasks in parallel on several processors.

Filter by
Sorted by
Tagged with
1 vote
1 answer
40 views

Desktop computing: who needs multi-threading, multi-processing; and how much?

I am currently running the KDE on OpenSuSE in a VirtualBox hosted by Windows 11 running on a processor with 14 cores. I gave Linux 4 CPUs to play with. So, I am aware of the need for some amount of ...
Steven Thomas Hatton's user avatar
0 votes
0 answers
18 views

Final outputs of running multiple processes at the same time

I'm encountering a problem. Given the following code: void withdraw(int x){ if (balance > x) balance = balance –x; else cout << ”failed”; }; Assume ...
Halam's user avatar
  • 1
3 votes
1 answer
282 views

Help understanding Petersons Algorithm for N Processes

I read the wikipedia article: https://en.m.wikipedia.org/wiki/Peterson%27s_algorithm What I don't understand is how the algorithm is guaranteed to work when the processor or processors are switching ...
FourierFlux's user avatar
2 votes
1 answer
57 views

Are there any operating systems that utilize only user threads?

We're going over threading models in my freshman CS class. Are there any examples of operating systems that use exclusively user threads (N:1)? It looks like 1:1 is far and away the most common model ...
James's user avatar
  • 21
0 votes
0 answers
29 views

SMP operating system that had been "proven" to be bug free?

Many years ago someone told me about a historical SMP operating system (or program?) that had been all but proven to be bug free (or something close to this). But yet turned out to have bugs that were ...
Morty's user avatar
  • 253
1 vote
1 answer
64 views

What happens if 2 processor try to access the same memory in one clock cycle?

Assume a parralled adder program: CPU0: ADD sum,eax;or LOCK ADD sum,eax CPU1: ADD sum,eax;or LOCK ADD sum,eax If these 2 instructions are issued in the same clock ...
Zackham's user avatar
  • 13
1 vote
0 answers
47 views

Puzzled by this interview problem of scheduling a computation graph on a single-processor under a memory constraint

I recently went through a interview session for a SWE/CS role at a well known company. It wasn't specifically a "coding-round" but was titled a "domain interview" session, so I ...
Joe Black's user avatar
  • 151
0 votes
1 answer
105 views

Reason that integers are used for priorities instead of float

Why are priorities always from a fixed set of integers? In operating systems priorities are integers typically between 1..MAX. But what is the reason that this is the case, when it would obviously be ...
Niklas Rosencrantz's user avatar
2 votes
2 answers
70 views

Is the kernel loaded into memory for every user simultaneously using a Multi-User O.S. system?

I have a doubt about loading kernel for every user using a Multi-User system. Every user's processes and programs are scheduled to CPU in a time-sharing fashion. But, do every user on the multi-user ...
Sandeep's user avatar
  • 121
0 votes
0 answers
24 views

Algorithm for dividing works into threads by priority

TL;DR Is there an existing algorithm for dividing W works each with priority P using T ...
Dorad's user avatar
  • 101
0 votes
0 answers
462 views

matrix product openMP code in C runs slower in parallel than series

If I start with 4 threads when I run my code and increase thread number each time I run it, my run time decreases as you would expect. However, my run time for 1 thread is significantly smaller than ...
Robin's user avatar
  • 1
1 vote
0 answers
38 views

Intelligent task distributor

On a distributed system, there are more than 50 machines than continuously read from a database which tasks they have to process. There is no criteria based on which a certain machine chooses which ...
tteguayco's user avatar
  • 111
2 votes
1 answer
567 views

Overhead cost of spawning child processes

I am curious as to the overhead cost of spawning child processes using fork in a Linux environment. Suppose I have a C program such as ...
Daniel Walker's user avatar
0 votes
1 answer
732 views

Cores, threads and sockets: what does it mean the calculation $T = tcs$ and the number on windows task manager performance?

Well, suppose then we have an CPU system such as: Thread(s) per core $\equiv t$ : 4 Core(s) per socket $\equiv c$: 4 Socket(s) $\equiv s$: 1 Then, we must to perform a simple ...
M.N.Raia's user avatar
  • 141
0 votes
1 answer
248 views

Thread - contention vs race

The terms contention and race are used interchangeably when it comes to thread's state(at critical section). Are they same?
Franc's user avatar
  • 103
2 votes
1 answer
920 views

Estimating P in Amdahl's Law theoretically and in practice

In parallel computing, Amdahl's law is mainly used to predict the theoretical maximum speedup for program processing using multiple processors. If we denote the speed up by S then Amdahl’s law is ...
Steve's user avatar
  • 123
2 votes
1 answer
62 views

How does a dual core microprocessors run so many programs?

I have a laptop with Intel dual core and it runs, the OS windows, and many application from Opera, age of empires, word, excel etc open at once just fine. If it only has 2 cores, how can so many ...
Vishwa Mithra Tatta's user avatar
-1 votes
1 answer
1k views

Calculation of speed up of a program executed in multi-threaded system

Speed up of execution of a program is to be calculated within a multi-threading rather than a single thread system. The program's 30% instruction can be executed serially & rest can be executed ...
Dipsankar Maity's user avatar
1 vote
0 answers
27 views

Parallel Thread Processing Variable Question

if there is a better stack exchange suited for this question please inform me. say you have a thread that is constantly checking the state of a variable in 2 ms intervals ...
James's user avatar
  • 11
1 vote
1 answer
421 views

How does the cpu know which process to wake?

In general, my understanding is: the cpu is executing a process/thread until either it is interrupted, the scheduler kicks it out, or it's waiting for something else (I/O for example), when it's put ...
Christian Vielma's user avatar
0 votes
1 answer
21 views

multithreading - duration of jobs

" How long will it take for 2 jobs to complete if they're running in parallel, knowing that both have a total of 20 minutes of CPU usage time and 50% IO" I calculated the CPU usage: ...
protoneight's user avatar
1 vote
0 answers
89 views

Task assignment problem with capabilities and time restrictions

I have the following optimalization problem. I use the notations below because maybe it would be easier to understand that way, but I'm not good at conventions – I'm not sure if I'm using it all the ...
Anonymouse's user avatar
1 vote
0 answers
31 views

Definition of PrefixSum function

I came across this paper and attempting to go through the implementation of randomized selection algorithm on page 8. Step 1 of the algorithm suggest to compute $s = PrefixSum(n_i, p)$. Where $p$ is ...
Paul's user avatar
  • 11
0 votes
1 answer
66 views

Can Multiprocessor Systems Implement Both Temporal Multithreading and Simultaneous Multithreading?

I am aware that multiprocessor systems often implement simultaneous multithreading in order to allow multiple threads to run on different CPUs. I am also aware that uni-core systems often implement ...
Cobie Fisher's user avatar
0 votes
1 answer
235 views

What is the Difference Between Many-to-Many (M:M) Threading and Hybrid (M:N) Threading?

I have been researching threading and come across several websites which all say contradicting statements about which and how many thread models exist. Some websites say there are only three: 1:1, M:1 ...
Cobie Fisher's user avatar
1 vote
0 answers
68 views

How to Optimise Each Multithreading Technique? (Cooperative/Preemptive/Simultaneous)

I am currently in the process of writing an IB Extended Essay on the efficacy of multithreading on increasing the performance of applications. So far, I have been able to deduce that there are three ...
Cobie Fisher's user avatar
4 votes
1 answer
174 views

Why does parallelising slow down this simple problem against looping through all the data?

I've been using multiprocessing and parallelisation for the first time this week on a very large data set using 32 CPUs. I decided to explore it for a smaller task just to see if I could learn ...
quanty's user avatar
  • 205
3 votes
2 answers
413 views

Skip List estimate number of elements less than (or greater than) a value

I am looking for a thread safe data structure where an element can be searched in $O(\log n)$, for any value, $x$, the number of elements greater than (or less than) can be estimated in $O(\log n)$,...
dan b's user avatar
  • 91
1 vote
0 answers
69 views

semaphore for two groups of processes

Can someone help me giving a pseudo code to this problem : There are two groups of processes , A and B. Maximum 3 Processes from group A or group B(only from one group) can use the given resource . ...
unnamed's user avatar
  • 65
4 votes
0 answers
159 views

Task scheduling algorithm that limits concurrency

My prof introduced us an algorithm with semaphores that was used to solve the "dining philosophers" problem. The algo is ok, apart from that it limits concurrency. What does mean that it "limits ...
Qwerto's user avatar
  • 341
0 votes
1 answer
460 views

Concurrency and fairness

I'm studying the concurrency in programming and the atomic instructions. What i have not understood is the concept of "fairness" applied to this matter. Can you give me an hint ?
Qwerto's user avatar
  • 341
0 votes
0 answers
36 views

Concurrency and non deterministm

I was introduced in concurrency programming this morning. I haven't understood why "non deterministm" is a fundamental aspect of cuncurrenty programming. What i think is that, since there is a ...
Qwerto's user avatar
  • 341
1 vote
1 answer
5k views

What does an "I/O Task" mean?

While reading an article, I noticed the use of term 'I/O Task': Indeed, suppose the currently running process is performing an I/O task (which, by definition, does not need the CPU to be accomplished)...
user6039980's user avatar
1 vote
1 answer
1k views

Does interrupt (for I/O and etc) requires support of Preemption? What is the relation between interrupts and Preemption in O.S?

So i just don't understand the relation between interrupts and Preemption in O.S? For example in Multi-programming, do we need the support of Preemption or not? when a process needs I/O and sends an ...
Richard Jones's user avatar
10 votes
2 answers
268 views

Why doesn't playing audio stop other tasks?

If processors can only execute one thing at a time, how come I can play music continuously and still be able to run other tasks? I understand the interrupt system, but isn't it needed that CPU ...
DreamIT's user avatar
  • 103
1 vote
2 answers
69 views

Beginnings of multiptogramming and compilations for it

I want to know how the first programs to be able to execute more than one programs within a common time span were like . I went through the history of the topic and it seemed like Strachey was the ...
itp dusra's user avatar
  • 161
2 votes
0 answers
264 views

Processor consistency and cache coherence

Consider this example from Wikipedia: ...
tierriminator's user avatar
2 votes
0 answers
370 views

many to many multithreading

In many to many multithreading model the processor threads are multiplexed to a lesser or equal number of kernel threads. What exactly does it mean?? Does it mean that if a kernel is executing a ...
Abhishek Dhankar's user avatar
10 votes
2 answers
16k views

What is meant by superlinear speedup? Is it possible to have superlinear speedup in practice?

In parallel computing, I know the speed up equation is $$ \frac{1}{ s + \frac{1-s}{p} } $$ But what is meant by superlinear speed up? Is it something theoritical? Could you explain it with ...
LuckyB's user avatar
  • 111
2 votes
1 answer
7k views

Multi-threading vs. Interrupt Handlers

In Arduino's architecture, multi-threading is not supported. However, interrupt handlers are being used as "placebo/replacement" if you may. However, I am not quite sure how these interrupt handlers ...
user avatar
45 votes
7 answers
11k views

Is there anything that MUST be done on a multi-core CPU?

When considering how multi-thread-friendly our program must be, my team puzzled about whether there's anything that absolutely cannot be done on a single-core CPU. I posited that graphics processing ...
Ky -'s user avatar
  • 599
0 votes
1 answer
456 views

Rate Monotonic First Fit vs. Rate Monotonic Next Fit vs. Proportionate Fair

What would an example of a set of tasks be, where RMFF, RMNF and P-Fair all result in a different number of processors required?
JollyGr33nGiant's user avatar
3 votes
0 answers
1k views

Proof of Manna-Pnueli algorithm for mutual exclusion being incorrect

Suppose we have the Manna-Pnueli algorithm for mutual exclusion: I was trying to find a sequence that violates mutual exclusion and I came up with this: ...
mewa's user avatar
  • 131
0 votes
1 answer
105 views

What is extra thread for idle time

Here http://tomstechnicalblog.blogspot.com/2016/02/rxjava-understanding-observeon-and.html I've found a sentence which I do not understand: If you have a quad-core, you can optimally support 5 ...
Marian Paździoch's user avatar
8 votes
2 answers
1k views

Why can't fibers utilize multiple processors?

It seems that the distinction between fibers and threads is that fibers are cooperatively scheduled, whereas threads are preemptively scheduled. The point of the scheduler seems like a way to make an ...
James M. Lay's user avatar
3 votes
2 answers
4k views

What is a student process?

According to Galvin and Silberschatz, 5 queues are maintained in multilevel queue scheduling, each for: System Process Interactive Process Interactive Editing Process Batch process Student Process ...
MAKZ's user avatar
  • 139
2 votes
1 answer
243 views

Is the consensus number of SetAgree(3, 2) 2 or 1 (proof needed)?

SetAgree(n, k) An object that allows n threads to propose() n values. It guarantees Each thread will decide() on a (single) value. The cardinal number of the set of all values decided on is lower or ...
AturSams's user avatar
  • 231
4 votes
1 answer
162 views

How are userland programs executed?

Say we have a simple OS with a filesystem, and some programs on that filesystem. How then does a program get executed by the OS? My understanding is that the executable file gets loaded into memory, ...
user avatar
6 votes
2 answers
3k views

Where is the OS when a process is running?

We know that operating system is responsible for handling memory allocation, process management etc. CPU can perform only one task at a time(assuming it to be single core). Suppose an operating system ...
Am_I_Helpful's user avatar