Is hyperthreading working in a concurrency or a parallelism pattern? [duplicate] - cpu

This question already has answers here:
Can a hyper-threaded processor core execute two threads at the exact same time?
(1 answer)
Does a hyperthreading CPU implement parallelism or just concurrency?
(2 answers)
How does hyperthreading affect parallelization?
(1 answer)
Closed 13 days ago.
I've read some articles explaining this. Not very sure about my understanding. Here is what I thought. It has both patterns. When there no executor resource conflicts between two threads, they work parallel(two threads working at the same time). Otherwise,they work concurrently(only one thread working at the same time).

Related

Number of blocked goroutines that a go application can handle [duplicate]

This question already has answers here:
How many write operation can be blocked in chan
(3 answers)
Does Go have an "infinite call stack" equivalent?
(1 answer)
Why simple Go app consume high memory usage
(1 answer)
Closed 27 days ago.
My question is I guess if we have a lot of goroutines waiting to acquire a lock and for some reason, the lock is not released then at some point we'll hit a memory or resource issue if too many goroutines are waiting.
I do understand that this definitely depends on the hardware as well but is there any limit on the number of blocked goroutines that the application might not be able to handle and crash?
Also, when a goroutine is blocked, what is the cost involved with it?

How does hardware (cpu or similar) provide any protection for the OS's essential memory [duplicate]

This question already has answers here:
What enforces memory protection in an OS?
(3 answers)
How do Operating Systems prevent programs from accessing memory?
(3 answers)
Closed 10 months ago.
So basically this might be a dumb question but how does hardware (cpu or related) protect virtual data even though all the cpu or any other hardware is doing is sending electricity around, it wouldn't make alot of sense for hardware to allow anything virtual allocated to be protected since of course its just electrical current. If it is actually possible for hardware to provide software/memory protection then how does it do it?

Do modern processors suffer from slowdowns due to instruction dependencies? [duplicate]

This question already has answers here:
Why doesn't GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)?
(12 answers)
Why does mulss take only 3 cycles on Haswell, different from Agner's instruction tables? (Unrolling FP loops with multiple accumulators)
(1 answer)
About the branchless binary search
(4 answers)
Closed 2 years ago.
While I was studying computer organization, we talked about data dependencies and how they limit the throughput of the pipeline because the execution of one instruction is blocked by another instruction not being done.
In modern processors, is it still the case? Is it possible to create a scenario in a real-world program where the CPU has enough data (it is not waiting for data from the memory), but due to data dependencies it is not running at full speed (maximum instructions per cycle)?
I believe that the compilers will try to break chains of dependencies. Are there cases when this is not possible?

Algorithm - to determine cache size [duplicate]

This question already has answers here:
Cache size estimation on your system?
(2 answers)
Measuring Cache Latencies
(5 answers)
Closed 2 years ago.
I was asked this question in an interview related to COMPUTER ARCHITECTURE.
Given an L1 cache, i can read and write into the cache and assuming it to be byte addressable and L2 and memory cache to be present in further hierarchy.
Describe an algorithm to find size of given cache
This was the only info given to me. Please tell me if I am missing any info/assumptions here.
Thanks

The maximum number of thread [duplicate]

This question already has answers here:
What's the maximum number of threads in Windows Server 2003?
(8 answers)
Closed 9 years ago.
What is the maximum number of thread in an application 32-bits and 64-bits developed in Delphi?
I need to know what is the limit of threads running simultaneously on a 32-bit application, because I'm doing performance analysis and I want to let the OS manage the execution order of the threads that are waiting.
You might want to read this answer: https://stackoverflow.com/a/481919/1560865
Still, what I wrote in my comment above stays partially true (but please also notice Martin James' objection to it below).
Notice that - generally speaking - if you create way more threads than
processor cores (or virtual equivalents), you will not gain any
performance advantage. If you create too many, you'll even end up with
pretty bad results like these:
thedailywtf.com/Articles/Less-is-More.aspx So are you completely sure
that you'll need the theoretically possible maximum number of threads?

Resources