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.

48 questions
45
votes
7 answers

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 requires massively parallel processing, but they…
Ky -
  • 599
  • 1
  • 4
  • 9
10
votes
2 answers

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 continuously process audio for it to not sound…
DreamIT
  • 103
  • 4
10
votes
2 answers

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 equations?
LuckyB
  • 111
  • 1
  • 1
  • 4
8
votes
2 answers

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 otherwise serial processor resource act in a…
James M. Lay
  • 183
  • 4
6
votes
2 answers

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 has allocated a CPU cycle to some user…
Am_I_Helpful
  • 424
  • 8
  • 18
4
votes
1 answer

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 anything, just on the 4 CPUs of my Mac. I created a task…
quanty
  • 205
  • 1
  • 5
4
votes
0 answers

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 concurrency" and why this happens ?
Qwerto
  • 341
  • 2
  • 8
4
votes
2 answers

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 where System process has highest priority and…
4
votes
1 answer

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, but after that I'm a little fuzzy. I understand…
Knyght
3
votes
2 answers

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)$, an element can be inserted in $O(\log n)$,…
3
votes
0 answers

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: 1. q1, q3; wantq=-1 2. p1 3. q4, q5; wantq=0 4. q1 5. p2; wantp=-1 6. p4 7. q3; wantq=-1 8.…
mewa
  • 131
  • 4
3
votes
1 answer

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 between threads. What stops simultaneous…
FourierFlux
  • 157
  • 3
2
votes
0 answers

Processor consistency and cache coherence

Consider this example from Wikipedia: P1 | W(x)1 ---------------------------------- P2 | R(x)1 W(x)2 ---------------------------------- P3 | R(x)2 R(x)1 ---------------------------------- P4 | …
2
votes
0 answers

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 blocking system call then the other threads will be…
Abhishek Dhankar
  • 169
  • 1
  • 10
2
votes
1 answer

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 work. For instance: void functionA() { //x is a…
user40759
1
2 3 4