I am no programmer but I think you cant just put cpu code in the memory until it is needed again. I think you can only do that with code caches that are actually on the cpu. Plus, your ram (on average) runs alot slower than your cpu. Cpu clock speed might be >3ghz but your ram speed is probably <1.6 ghz. the fastest ram I have seen is 2 ghz and I have seen cpus that run 4 ghz stock.
I believe it would desync because decompiling, recompiling, and executing take different amounts of time.
if the cpu is faster, then it can load "ahead" and save to memory. usually reading is much faster than writing. so all core 2 has to do is read the ram, right?
Quote:I am no programmer but I think you cant just put cpu code in the memory until it is needed again.
...of course you can. This is essentially what a cpu does when it runs a program. It executes machine code and the results are stored in the memory allocated to that program and fetched back when they are needed again.
Quote: Plus, your ram (on average) runs alot slower than your cpu.
This is not an apples to apples comparison since they serve two different functions. RAM stores data while a microprocessor changes data. If your referring to a cpu executing code faster than it can be read/written to the memory, well that depends on what type of math it is. It can be much faster or much slower. Memory almost never bottlenecks the cpu now and days, it can happen but it's rare.
Quote:Cpu clock speed might be >3ghz but your ram speed is probably <1.6 ghz
Clock rate has nothing to do with anything, this is not an apples to apples comparison. For example XDR ram running at 250MHz can easily acheieve 4 times the bandwidth of ddr3 running at 1400MHz 8-8-8-24. I can't even begin to explain what is wrong with that logic. CPU/Memory clock rates are not comparable and have no relation, period.
Quote:why not try to decompile in core 1 recompile in core 2 execute in core 3 and exucute dsp and gpu (step 4) in core 4?
Because you can't separate those. And even if you could it would massively slow things down since the process of reading/writing to the memory and storing different types of code back and forth would make everything run so slow. It's like having a program that has to open/close itself anytime it does any work.
Quote:if the cpu is faster, then it can load "ahead" and save to memory. usually reading is much faster than writing. so all core 2 has to do is read the ram, right?
Load what ahead? It hasn't done the next part yet and it has to wait until it's finished writing the previous results to memory before it can begin. You can't load the results to an equation that hasn't been done yet.
wait so you can put cpu instructions in the ram until they are needed?
.....yes
Whenever you run a program the instructions and data are loaded into ram. The cpu then begins a 4 stage cycle that repeats endlessly:
1. Fetch data and instructions from ram into registers
2. Decode instructions
3. Execute instructions (input data and instructions, output data)
4. Load/Store resulting data (loading is storing the result in the register so it can be instantly reused, storing is is writing it to the ram so it can be stored for later)
Then it goes back to step 1 and repeats endlessly. Your ram is essentially a holding ground for instructions and data that the cpu is not currently using, that is it's purpose. This is why your question made me laugh because it's like asking "wait so you can do math with a system of 0s and 1s?". Whenever you do literally anything on your computer you are storing instructions in ram!