Questions tagged [cpu]

CPU is the abbreviation for central processing unit. Sometimes referred to simply as the central processor, but more commonly called processor

Filter by
Sorted by
Tagged with
33 votes
7 answers
7k views

Why do modern operating systems *ever* have perceptible input (keyboard/mouse) lag?

Sometimes computers stutter a bit when they're working hard, to the point where the mouse location freezes for a fraction of a second, or stutters intermittently for a few seconds. This sometimes ...
user avatar
-2 votes
1 answer
151 views

What is the benefit of equipping a computer or smartphone with multiple CPU cores that differ in clock speed? [closed]

I've bought a samsung galaxy s21 ultra about a year ago. Today i was looking at the specs again and i noticed that the Samsung Exynos 2100 processor consists out of 1 single CPU core of 2.9 GHz, three ...
user avatar
  • 123
-1 votes
2 answers
105 views

What happens when one thread is waiting to be executed while another is waiting for input?

Suppose I have two threads, A and B. A is waiting for input, while B is waiting to be executed. All other CPU cores are busy with CPU-bound tasks. What will happen to A?
user avatar
  • 2,001
-4 votes
2 answers
101 views

Archival-quality future-proof pseudo-CPU architecture

Suppose we maintain a massive electronic library of texts/photos/videos etc., and want to ensure that these files are readable indefinitely long in the future. So we: Keep snapshots of versions of ...
user avatar
2 votes
0 answers
68 views

Branch Prediction: How does a correlative branch predictor select from the global history?

I am trying to understand how branch prediction works, specifically with regards to correlative branch prediction. I understand that in an (m, n) branch predictor, there are m branch predictors, with ...
user avatar
  • 129
0 votes
2 answers
94 views

Efficiency of different Processors and GPUs

My question is, knowing everything there is to know about several systems(CPU and GPU stats, OS), is it possible to approximate when each system will finish a specific processing operation? And if it ...
user avatar
  • 31
-3 votes
3 answers
128 views

ALU and register relations

Does the ALU have its own memory or registers where it stores input operands etc. or does it only use CPU registers (that aren't only specifically used for ALU tasks)?
user avatar
1 vote
3 answers
435 views

How do binary numbers interact with the CPU and cause some action to take place? [duplicate]

EDIT: Perhaps what I am misunderstanding is that when it is said that the code we type gets turned into machine code of 0s and 1s. If these 0s and 1s are the abstracted representation of their ...
user avatar
  • 31
-3 votes
1 answer
115 views

How to anticipate a software future where ARM (potentially) replaces x86 in server and PCs? [closed]

With the introduction of Apple M1 processor, ARM has stood up to be a capable competitor and an alternative to x86 processors. We can foresee a future where ARM captures considerable market share of ...
user avatar
  • 113
-1 votes
1 answer
79 views

How to calculate the computing power gap of different CPUs

I want to compare the performance gap between the two machines, the main consideration here is memory and CPU. For example, the theoretical calculation peak of the CPU. Theoretical CPU peak = main ...
user avatar
59 votes
10 answers
23k views

Does it ever make sense to use more concurrent processes than processor cores?

I've got some process in Go. Here's an example counting lines in text, though the question is meant to be far more general than this particular example: func lineCount(s string) int { count := 0 ...
user avatar
6 votes
3 answers
563 views

How does an OS limit a program capabilities, if it's working directly with the cpu?

When a program loads into memory and starts running, the cpu loads each instruction from the code and executes the instruction based on the opcode and the arguments, so, the program interracts so to ...
user avatar
  • 176
8 votes
9 answers
5k views

Why is multithreading not used everywhere?

Not almost, but all modern CPUs have multiple cores, yet multithreading isn't really that common. Why to have these cores then? To execute several sequential programs at the same time? Well, when ...
user avatar
  • 225
-4 votes
1 answer
109 views

Where on the 64bit memory of a PC would one byte end up?

I have a simple question I think. A typical pc with ram has a 64bit databus between the cpu and ram. Let's say the ram starts at address 0, and I write i byte to address 0. Now my question is, would ...
user avatar
3 votes
7 answers
2k views

Is it possible to update exactly 1 byte in RAM?

For example I have a static C++ array {'d', 'o', 'c', 's'}. And I have x86 architecture, with 32-bits length words. I want to replace letter c with g. As far as I understand, when we make a read ...
user avatar
-3 votes
2 answers
73 views

How specific is hardware optimization when building from source/how do I know?

How specific is hardware optimization when building from source and what should I look for in the documentation to decide if building for my hardware might be worth it? From threads like this one I ...
user avatar
-4 votes
5 answers
718 views

Why can't we vertically scale a system infinitely?

When talking about scaling a system, it's often said that vertical scaling has limitations. So after a point, we need to scale the system horizontally. What are the limitations of: Main memory - ...
user avatar
  • 111
0 votes
2 answers
942 views

How to speed up my software development workflow? I'm using Visual Studio 2019 to build, compile, run tests for dotnet, C#, Docker containers, etc

I am primarily working with C#, dotnet and Visual Studio 2019 with extensions like Resharper enabled. Visual Studio with Resharper is a memory hog. I currently have the following PC at home where I ...
user avatar
-2 votes
2 answers
2k views

How are electrons moved in processors/CPU? [duplicate]

During our class, he posed the question 'How are electrons moved by code' for our own reflection, the question seems to be vague but I assumed how are electrons moved in a processor/CPU since we were ...
user avatar
  • 23
-2 votes
1 answer
165 views

Does accessing RAM from 2 threads double access time (synchronous access)?

As in topic. If i want to access RAM from 2 different threads, completly different cells in memory, do they queue and are sent asynchronously or queue? Lets say accessing memory from one thread (...
user avatar
3 votes
2 answers
1k views

How is it possible for a process to use less than 100% CPU?

I don't know too terrible much about the CPU, but I know it processes assembly instructions and that Windows can say that it is at anywhere from 1-100% usage. How is it possible for a program to use ...
user avatar
  • 165
3 votes
1 answer
234 views

What are the restrictions for the CPU when it is in user mode?

I know that when the CPU is in user mode, it can't access all memory, it also can't execute some CPU instructions (called "privileged instructions" I believe). But are these two restrictions the only ...
user avatar
  • 1,981
2 votes
3 answers
3k views

Comparison of build times on various hardware; why non-linear results?

Why do the compile times not vary significantly between different era CPUs, even though disk (NVMe vs. HDD) and CPU benchmarks vary significantly in performance? Why does disabling hyperthreading ...
user avatar
0 votes
2 answers
193 views

How did old OSs create or expand a segment in memory without issues?

On an 8086 CPU before the flat memory model had been adopted, when the OS wanted to create a new segment for a process, how did it know what virtual memory ranges were already covered by existing ...
user avatar
3 votes
4 answers
3k views

How to align on both word size and cache lines in x86

From what it sounds like, a 64 bit processor means aligning to 64 bits, which means if you have unicode utf-8 stored in there, each 8-bit chunk would take up 64 bits of space. That doesn't really make ...
user avatar
  • 2,412
-6 votes
1 answer
80 views

two processes with same execute time [closed]

Process A take 10 seconds to finish an execution. Process B take 10 seconds to finish an execution. Is it possible to take 5, 8, 15 seconds to finish an execeution if they run stimulately.
user avatar
  • 1
1 vote
2 answers
5k views

What is more efficient: Reading and parsing a large JSON file, or large CSV file?

I plan on using Scrapy to crawl a local website for a LOT of data and store it in a file. Then I plan to parse that file and put some of the data in a SQL database. Will my computer use less CPU and ...
user avatar
  • 143
0 votes
4 answers
1k views

Does instruction length affect cycles per instruction?

ISAs define things like instruction lengths and the instructions themselves and there are some things that I do not understand. Does the instruction length (the amount of bits) affect the amount of ...
user avatar
3 votes
1 answer
2k views

What receives the output of the ALU?

I know that the Arithmetic Logic Unit (ALU of a processor performs arithmetic (and bitwise) operations and the result is stored as the ALU's output - but what component, device or software is actually ...
user avatar
8 votes
2 answers
6k views

How does a CPU load multiple bytes at once if memory is byte addressed?

I've been reading about CPUs and how they are implemented, and some big complex architectures (looking at you x86) have instructions that load from memory during one clock cycle. Since one address ...
user avatar
  • 125
1 vote
2 answers
334 views

Increase processing use of Digital Signal Processor

I have a DSP (Digital Signal Processor) with a very well defined application, (this explication will be simplified) The DSP uses TDM (Time Division Multiplexer) frames to receive audio information, ...
user avatar
6 votes
3 answers
6k views

What does "address space" means when talking about IO devices?

The following quote is from this page: While some CPU manufacturers implement a single address space in their chips, others decided that peripheral devices are different from memory and, ...
user avatar
  • 1,981
2 votes
1 answer
240 views

What does "data bus control" mean?

This video mentions the following: What does it mean for the DMA controller to be granted the data bus control, does that mean the CPU cannot use the bus to access memory and IO devices until the DMA ...
user avatar
  • 1,981
5 votes
3 answers
2k views

What happens to multiple parallel tasks running on a server when CPU hits 100% usage?

I am running 10 instances of the same executable where each executable is accessing a different 1/10 chunk of the total data that needs to be processed on a Windows Server 2012 R2. (Intel(R) Xeon(R) 2....
user avatar
  • 161
-1 votes
1 answer
1k views

Feature of CPU needed to run Javascript fast

This is more of a Computer Engineering question, but what is the feature of a CPU to run Javascript fast? I use to access the internet with an AMD Phenom II with 6 cores and I could almost have as ...
user avatar
  • 159
70 votes
3 answers
56k views

How does a single thread run on multiple cores?

I am trying to understand, at a high-level, how single threads run across multiple cores. Below is my best understanding. I do not believe it is correct though. Based on my reading of Hyper-threading,...
user avatar
  • 1,406
2 votes
3 answers
250 views

Why are CPUs' datapaths multiple of 8?

Current and common processing units are 8, 16, 32, 64, 128, etc bit. Why are their datapath multiple of 8 ? Is this all linked to the fact that the industry has settled with a 8-bit byte ? The PDP-7 ...
user avatar
  • 129
8 votes
2 answers
7k views

Separate Thread Pools for I/O and CPU Tasks

I've been puzzling over a good implementation for this for a while. I have a program that does a long-running I/O operation (downloading a file) and a long-running CPU operation (parsing its contents)...
user avatar
  • 209
1 vote
2 answers
7k views

How to maximize the CPU usage of a Python subprocess?

I have a Python script launching a C++ executable. The C++ executable is a multithreaded program that usually takes several hours to run. The way the C++ code is written, it will run on all the ...
user avatar
  • 179
11 votes
3 answers
1k views

Why do compilers typically only generate executables for the platform they are installed on?

I'm a C++ developer and in an attempt to better understand cross-platform development, I'm trying to get a better understanding of some implementation details of compilers and how exactly they create ...
user avatar
  • 459
3 votes
4 answers
16k views

The difference between accumulator-based and register-based CPU architecture?

I don't understand the difference between an accumulator-based CPU architecture and a register-based CPU architecture. I know x86 is register-based but it has an accumulator-like register. I only ever ...
user avatar
0 votes
2 answers
1k views

How to calculate how much of the CPU is used?

Say we have an interrupt that is generated once each time that 1024 bytes of network traffic arrives. Each interrupt takes 3.5 microseconds to process and the network speed is 100Mb.We want the ...
user avatar
3 votes
4 answers
591 views

Is it possible for a computer system to have constant/zero CPU load?

For example, a simple program in a simulated environment that waits for user input seems to be doing no work, so I guess it uses CPU only for the time. I'd like to know if computer systems (that don'...
user avatar
1 vote
3 answers
1k views

Why can less precise data like float be faster than larger, more precise data like double?

I am currently reading a chapter in a textbook on Processor Architecture and saw the following statement: The less precision there is, the less space is occupied by a program variable in memory. ...
user avatar
-6 votes
2 answers
2k views

How does the web application support 150 max threads when the cpu only supports 2? [duplicate]

doing an lscpu cmd this is what i get $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: ...
user avatar
  • 1
0 votes
1 answer
356 views

How is the data path controlled between ALU and registers?

On some machines the operation of data path between ALU and registers is controlled by microprogram . On some machines , it is controlled by hardware .On machines with software control of the data ...
user avatar
0 votes
4 answers
990 views

When it is worth it to spend RAM for computational speed? [closed]

I am developing data analytics algorithms that are supposed to process large amounts of data. Thus I am aiming to develop my mathematics already in such a way that it is possible to distribute the ...
user avatar
  • 297
2 votes
3 answers
3k views

Source of loading value to the register or memory location

When we load a register or memory location with a value (e.g. MVI 3A or MVI 53), what initializes register or memory location with that specific value? It is the CPU who performs the initialization, ...
user avatar
  • 293
0 votes
2 answers
121 views

How to wait for a certain amount of time if time functions are not reliable [closed]

How can I manage my code to exactly wait for a certain amount of time (say 10s), if all * time functions on the system are not reliable and return immediately ? Sleep(10000); // Do not sleep for 10s ...
user avatar
  • 23
1 vote
2 answers
448 views

How can an interpreter produce output of some code, without having the computing components like ALU of a processor?

I have gone through lot of explanations about a compiler and interpreter. I think I understood the difference between compiler and interpreter clearly. I'll explain my learning through the following ...
user avatar
  • 161