Questions tagged [cpu]

The central processing unit or "processor" inside a computer which executes the instructions in a computer program.

The central processing unit (CPU) is the portion of a computer system that carries out the instructions of a computer program, and is the primary element carrying out the computer's functions. The central processing unit carries out each instruction of the program in sequence, to perform the basic arithmetical, logical, and input/output operations of the system. This term has been in use in the computer industry at least since the early 1960s. The form, design and implementation of CPUs have changed dramatically since the earliest examples, but their fundamental operation remains much the same.

Source: Wikipedia

4662 questions
36
votes
2 answers

x86 LOCK question on multi-core CPUs

Is it true that the x86 ASM "LOCK" command prefix causes all cores to freeze while the instruction following "LOCK" is being executed? I read this in a blog post and it doesn't make sense. I can't find anything that indicates if this is true or not.
IamIC
  • 17,747
  • 20
  • 91
  • 154
35
votes
3 answers

Portable way of detecting number of *usable* CPUs in Python

Per this question and answer -- Python multiprocessing.cpu_count() returns '1' on 4-core Nvidia Jetson TK1 -- the output of Python's multiprocessing.cpu_count() function on certain systems reflects the number of CPUs actively in use, as opposed to…
Hephaestus
  • 1,982
  • 3
  • 27
  • 35
35
votes
3 answers

How to use all CPU cores/threads when running Android Studio gradle build?

I'm looking for a parameter or configuration in Android Studio / Gradle, that can set the build so it will use all of my CPU cores during build time. i.e. If I have a quad-core CPU and each core is running 8 threads, how can I optimize the build…
ori888
  • 740
  • 1
  • 8
  • 17
34
votes
4 answers

Why is a CPU branch instruction slow?

Since I started programming, I have read in every place to avoid wasteful branches at all costs. That's fine, although none of the articles explained why I should do this. What exactly happens when the CPU decodes a branch instruction and decides to…
34
votes
5 answers

Get CPU Temperature

I want to get the CPU temperature. Below is what I've done using C++ and WMI. I'm reading MSAcpi_ThermalZoneTemperature, but it's always the same and it's not the CPU temperature at all. Is there any way to get the real temperature of the CPU…
Johnny Mnemonic
  • 3,822
  • 5
  • 21
  • 33
34
votes
2 answers

Cache or Registers - which is faster?

I'm sorry if this is the wrong place to ask this but I've searched and always found different answer. My question is: Which is faster? Cache or CPU Registers? According to me, the registers are what directly load data to execute it while the cache…
user1255454
  • 669
  • 1
  • 8
  • 18
33
votes
15 answers

Limiting certain processes to CPU % - Linux

I have the following problem: some processes, generated dynamically, have a tendency to eat 100% of CPU. I would like to limit all the process matching some criterion (e.g. process name) to a certain amount of CPU percentage. The specific problem…
asparagus
  • 416
  • 1
  • 6
  • 9
33
votes
2 answers

AES-NI intrinsics enabled by default?

Oracle has this to say about Java 8 with regards to AES-NI: Hardware intrinsics were added to use Advanced Encryption Standard (AES). The UseAES and UseAESIntrinsics flags are available to enable the hardware-based AES intrinsics for Intel…
Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
33
votes
4 answers

What is the difference between CUDA core and CPU core?

I worked a bit with CUDA, and a lot with the CPU, and i'm trying to understand what is the difference between the two. My I5 processor has 4 cores and cost $200 and my NVidia 660 has 960 cores and cost about the same. I would be really happy if…
OopsUser
  • 4,642
  • 7
  • 46
  • 71
33
votes
4 answers

What is this "denormal data" about ? - C++

I would like to have a broad view about "denormal data" and what it's about because the only thing that I think I got right is the fact that is something especially related to floating point values from a programmer viewpoint and it's related to a…
user1849534
  • 2,329
  • 4
  • 18
  • 20
32
votes
2 answers

Implementation of __builtin_clz

What is the implementation of GCC's (4.6+) __builtin_clz? Does it correspond to some CPU instruction on Intel x86_64 (AVX)?
Cartesius00
  • 23,584
  • 43
  • 124
  • 195
32
votes
3 answers

CPUID implementations in C++

I would like to know if somebody around here has some good examples of a C++ CPUID implementation that can be referenced from any of the managed .net languages. Also, should this not be the case, should I be aware of certain implementation…
Kris
  • 2,100
  • 5
  • 31
  • 50
32
votes
4 answers

Is stack in CPU or RAM?

I have a few question about stack. Is stack in CPU or RAM? Is stack a place to run OPcode? Is EIP in CPU or RAM?
abiati madana
  • 331
  • 1
  • 3
  • 3
31
votes
8 answers

Threads configuration based on no. of CPU-cores

Scenario : I have a sample application and I have 3 different system configuration - - 2 core processor, 2 GB RAM, 60 GB HHD, - 4 core processor, 4 GB RAM, 80 GB HHD, - 8 core processor, 8 GB RAM, 120 GB HHD In order to effectively exploit the H/W…
Santosh
  • 782
  • 4
  • 15
  • 38
30
votes
1 answer

What is socket, core, threads, CPU?

I am currently volunteering to learn about linux servers and also I am interested in learning about cluster computing techniques. In this lab, they have a small cluster with one head node and two compute nodes. When I tried the lscpu command on…
bioinforesearch
  • 427
  • 1
  • 4
  • 8