
A Gentle Introduction to Multithreading - based2
https://www.internalpointers.com/post/gentle-introduction-multithreading
======
keymone
It is very gentle indeed.

Personally i've come to conclusion that computers are better at managing
threads than i am, just like compilers are, for many decades now, better at
managing CPU registers.

It can definitely be enjoyable to ponder on some threading puzzle, now and
then, but I very much prefer higher level abstractions like CSP or STM.
Threads are not for human consumption.

------
based2
[https://www.reddit.com/r/programming/comments/azr7n6/a_gentl...](https://www.reddit.com/r/programming/comments/azr7n6/a_gentle_introduction_to_multithreading/)

------
renholder
> _it is not 100% guaranteed that threads will perform their operations truly
> in parallel, that is at the same time: it really depends on the underlying
> hardware._

I thought it really depended on a _lot_ of factors, most predominantly thread
scheduling (based on thread priority)[0]?

[0] - [https://docs.microsoft.com/en-
us/windows/desktop/ProcThread/...](https://docs.microsoft.com/en-
us/windows/desktop/ProcThread/scheduling-priorities)

~~~
Lerc
Are there any operating systems that let you explicitly run CPUs in parallel?

I'm thinking n threads where the process requests the operating system
scheduler to start and stop them all at the same time. Of course the OS would
be permitted to refuse if it wasn't capable (or just not allowed).

A synchronised cpu master-slave relationship could be beneficial to
parallelize some of the middle ground between instruction level parallelism
and multi-threading

~~~
mav3rick
You can do a set affinity on Linux but it isn't a guarantee.

------
known
Please note that

    
    
      Application can allocate memory. 
      Application cannot allocate CPU; 
      OS does that;

------
amelius
Is there a good overview of different concurrency/parallelism models and
related abstractions somewhere?

~~~
znpy
Seven Concurrency Models in Seven Weeks:
[https://pragprog.com/book/pb7con/seven-concurrency-models-
in...](https://pragprog.com/book/pb7con/seven-concurrency-models-in-seven-
weeks)

