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
30
votes
7 answers

Accessing CPU temperature in python

I need an example code for accessing CPU temperature in python. I'm running windows 7, BTW.
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
30
votes
1 answer

What happens after a L2 TLB miss?

I'm struggling to understand what happens when the first two levels of the Translation Lookaside Buffer result in misses? I am unsure whether "page walking" occurs in special hardware circuitry, or whether the page tables are stored in the L2/L3…
user997112
  • 29,025
  • 43
  • 182
  • 361
30
votes
8 answers

How to programmatically get the CPU cache line size in C++?

I'd like my program to read the cache line size of the CPU it's running on in C++. I know that this can't be done portably, so I will need a solution for Linux and another for Windows (Solutions for other systems could be useful to others, so post…
Mathieu Pagé
  • 10,764
  • 13
  • 48
  • 71
29
votes
3 answers

Is it possible to set custom CPU throttling in Chrome DevTools?

I am using Google Chrome 63. In DevTools in Performance tab there are three CPU throttling settings: "No throttling", "4x slowdown" and "6x slowdown". Is it possible to set custom throttling, for example "20x slowdown"? It could be via setting some…
ScriptyChris
  • 639
  • 4
  • 16
  • 48
29
votes
4 answers

Why don't stacks grow upwards (for security)?

This is related to the question 'Why do stacks typically grow downwards?', but more from a security point of view. I'm generally referring to x86. It strikes me as odd that the stack would grow downwards, when buffers are usually written to upwards…
AshleysBrain
  • 22,335
  • 15
  • 88
  • 124
29
votes
12 answers

Getting CPU temperature using Python?

How do I retrieve the temperature of my CPU using Python? (Assuming I'm on Linux)
jamieb
  • 9,847
  • 14
  • 48
  • 63
29
votes
3 answers

why does perf stat show "stalled-cycles-backend" as ?

Running perf stat ls shows this: Performance counter stats for 'ls': 1.388670 task-clock # 0.067 CPUs utilized 2 context-switches # 0.001 M/sec 0…
oliver
  • 6,204
  • 9
  • 46
  • 50
28
votes
3 answers

High CPU usage of javascript - How to debug?

What is the best way to find the cause of high cpu usage of javascript? I have a script that simply loads photos from flickr in a thumbnail gallery. After they're loaded, nothing is being done (waiting for you to click them to display in a…
user429620
28
votes
1 answer

why parallel execution on java compile take linear growth in time

time javac Main.java --> 0m1.050s time javac Main.java & javac Main.java --> 0m1.808s time javac Main.java & javac Main.java & javac Main.java --> 0m2.690s time javac Main.java & ... 8 time …
Bhuvan
  • 4,028
  • 6
  • 42
  • 84
28
votes
8 answers

Detecting the number of processors

How do you detect the number of physical processors/cores in .net?
Peter C
  • 2,257
  • 2
  • 25
  • 28
28
votes
4 answers

Python - get process names,CPU,Mem Usage and Peak Mem Usage in windows

I am wanting to get a list of all the process names, CPU, Mem Usage and Peak Mem Usage. I was hoping I could use ctypes. but I am happy to hear any other options. Thanks for your time.
Daniel
  • 295
  • 1
  • 3
  • 5
28
votes
3 answers

How many CPU cores does a Heroku Dyno have?

I'm using Django with Celery 3.0.17 and now trying to figure out how many celery workers are run by default. From this link I understand that (not having modified this config) the number of workers must be currently equal to the number of CPU cores.…
jcatalan
  • 283
  • 1
  • 3
  • 7
27
votes
15 answers

Identifying the CPU architecture type using C#

I want to check which CPU architecture is the user running, is it i386 or X64 or AMD64. I want to do it in C#. I know i can try WMI or Registry. Is there any other way apart from these two? My project targets .NET 2.0!
Anirudh Goel
  • 4,571
  • 19
  • 79
  • 109
27
votes
6 answers

What is the equivalent of /proc/cpuinfo on FreeBSD v8.1?

What is the equivalent of Linux's /proc/cpuinfo on FreeBSD v8.1? My application reads /proc/cpuinfo and saves the information in the log file, what could I do to get similar information logged on FreeBSD? A sample /proc/cpuinfo looks like…
WilliamKF
  • 41,123
  • 68
  • 193
  • 295
27
votes
4 answers

Algorithms FPGAs dominate CPUs on

For most of my life, I've programmed CPUs; and although for most algorithms, the big-Oh running time remains the same on CPUs / FPGAs, the constants are quite different (for example, lots of CPU power is wasted shuffling data around; whereas for…
anon
  • 41,035
  • 53
  • 197
  • 293