Questions tagged [multithreaded]

7 questions
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
2 answers

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 multi-processing and multi-threading. But when…
1
vote
2 answers

Can multi-threading help improve an IO-bound process perforamance?

I am trying to understand the difference between CPU Bound vs IO Bound process. ChatGPT suggested that multi-threading/parallel processing can help CPU bound process; However, I think that having mulithreading can help with IO Bound process. Let's…
Sahil
  • 149
  • 3
1
vote
1 answer

Multithreaded quicksort

The runtime of Quicksort can be significantly reduced if multiple threads running on multiple cores can be used. With just two cores, just partition an array into two halves and let another thread sort the second half. The problem is that with many…
gnasher729
  • 32,238
  • 36
  • 56
0
votes
0 answers

Is hardware multithreading SIMD or MIMD?

I have spent some time looking into Flynn's taxonomy but there is one aspect I still can not figure out. I have learned about the following aspects of hardware multithreading: fine-grained, coarse-grained, and simultaneous multithreading. The latter…
albin
  • 1
  • 1
0
votes
1 answer

Internal implementtation of Spin Locks with Test-And-Set and CompareAndSwap

I am going through this chapter https://pages.cs.wisc.edu/~remzi/OSTEP/threads-locks.pdf , I read the author mentioning Test-And-Set and CompareAndSwap's being atomic. Please find the code snippets below int TestAndSet(int *old_ptr, int new) { …
Vivek Anand
  • 103
  • 2
0
votes
0 answers

given a list of 3 dimension what is the best approach to find the highest sum

We are given a file of three columns - the first is player name - the second is game item name - the third is the price of the game item when bought by the player items may repeat for the same player with different prices What is the best parallel…