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
67
votes
5 answers

How to set CPU affinity of a particular pthread?

I'd like to specify the CPU-affinity of a particular pthread. All the references I've found so far deal with setting the CPU-affinity of a process (pid_t) not a thread (pthread_t). I tried some experiments passing pthread_t's around and as expected…
Michael Wagner
61
votes
12 answers

Is integer multiplication really done at the same speed as addition on a modern CPU?

I hear this statement quite often, that multiplication on modern hardware is so optimized that it actually is at the same speed as addition. Is that true? I never can get any authoritative confirmation. My own research only adds questions. The speed…
exebook
  • 32,014
  • 33
  • 141
  • 226
60
votes
2 answers

FLOPS per cycle for sandy-bridge and haswell SSE2/AVX/AVX2

I'm confused on how many flops per cycle per core can be done with Sandy-Bridge and Haswell. As I understand it with SSE it should be 4 flops per cycle per core for SSE and 8 flops per cycle per core for AVX/AVX2. This seems to be verified…
user2088790
58
votes
2 answers

What is a clock cycle and clock speed?

I have been reading a book about the Computer's Processor. And I came across some of the terms like clock Ticks, clock Cycle and clock Speed that I am finding very difficult to understand. I will be very thankful if someone can clarify this in a…
user7876385
56
votes
19 answers

Unable to start Genymotion virtual device, incompatible CPU

The first time I ran Genymotion virtual device, it had worked. But when I tried running it today, I got this error message What may have changed from the last time I used it? Will be grateful for any solutions that I can get. Thanks. My Device…
saurjk
  • 973
  • 3
  • 13
  • 27
54
votes
4 answers

How can I measure CPU time and wall clock time on both Linux/Windows?

I mean: how can I measure time my CPU spent on function execution and wall clock time it takes to run my function? (Im interested in Linux/Windows and both x86 and x86_64). See what I want to do (Im using C++ here but I would prefer C solution): int…
yak
  • 3,770
  • 19
  • 60
  • 111
54
votes
3 answers

Get CPU/GPU/memory information

I need to get any information about the CPU/GPU/memory.The number of cores, memory value, memory and cpu usage... I found a way to do this for IE:How to Use JavaScript to Find Hardware Information solutions for other browsers I do not know. Any idea…
Alex Nester
  • 541
  • 1
  • 4
  • 3
53
votes
2 answers

Small file upload to s3 hangs with 100% CPU usage using Paperclip

I have a directory of <20MB pdf files (each pdf represents an ad) on an AWS EC2 large instance. I'm trying to upload each pdf file to S3 using ruby and DM-Paperclip. Most files upload successfully but some seem to take hours with the CPU hanging at…
UserFrank
  • 531
  • 3
  • 5
52
votes
3 answers

What's the difference between conflict miss and capacity miss

Capacity miss occurs because blocks are being discarded from cache because cache cannot contain all blocks needed for program execution (program working set is much larger than cache capacity). Conflict miss occurs in the case of set associative or…
xiaodong
  • 952
  • 1
  • 7
  • 19
52
votes
4 answers

How can I do a CPU cache flush in x86 Windows?

I am interested in forcing a CPU cache flush in Windows (for benchmarking reasons, I want to emulate starting with no data in CPU cache), preferably a basic C implementation or Win32 call. Is there a known way to do this with a system call or even…
user183135
  • 3,095
  • 2
  • 18
  • 7
51
votes
2 answers

Is x86 RISC or CISC?

According to Wikipedia, x86 is a CISC design, but I also have heard/read that it is RISC. What is correct? I'd to also like to know why it is CISC or RISC. What determines if a design is RISC or CISC? Is it just the number of machine language…
wowpatrick
  • 5,082
  • 15
  • 55
  • 86
50
votes
3 answers

The difference between Call Gate, Interrupt Gate, Trap Gate?

I am studying Intel Protected Mode. I found that Call Gate, Interrupt Gate, Trap Gate are almost the same. In fact, besides that Call Gate has the fields for parameter counter, and that these 3 gates have different type fields, they are identical in…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
50
votes
6 answers

How to fast get Hardware-ID in C#?

I need in my program to tie a license to a hardware ID. I tried use WMI, but it still slow. I need, for example, CPU, HDD, and motherboard info.
guaike
  • 2,471
  • 9
  • 31
  • 42
49
votes
1 answer

android - what is message queue native poll once in android?

I know that threads have a message queue and handlers are able to push runnables or messages to them, but when I profile my android application using Android Studio tools, there is a strange process: android.os.MessageQueue.nativePollOnce It uses…
Sajad Norouzi
  • 1,790
  • 2
  • 17
  • 26
49
votes
5 answers

CPU throttling in C++

I was just wondering if there is an elegant way to set the maximum CPU load for a particular thread doing intensive calculations. Right now I have located the most time-consuming loop in the thread (it does only compression) and use GetTickCount()…
Piotr Tyburski
  • 651
  • 6
  • 11