Ask Slashdot: What's the Most Often-Run Piece of Code -- Ever?
Hugo Villeneuve writes "What piece of code, in a non-assembler format, has been run the most often, ever, on this planet? By 'most often,' I mean the highest number of executions, regardless of CPU type. For the code in question, let's set a lower limit of 3 consecutive lines. For example, is it:
- A UNIX kernel context switch?
- A SHA2 algorithm for Bitcoin mining on an ASIC?
- A scientific calculation running on a supercomputer?
- A 'for-loop' inside on an obscure microcontroller that runs on all GE appliance since the '60s?"
for(;;){
}
OR
while(1){
}
Starts all main control loops and all kernels.
Every Ask Slashdot gets a comment pointing out that it's the dumbest Ask Slashdot ever, I know.
This time, it's really, really the case.
CLI paste? paste.pr0.tips!
I would have to guess some code in BIOS that's pretty much the same on every platform. The POST components for memory checking, for instance. That might actually get disqualified as they may be written in assembler?
Indeed.
Must be the SlashCode "asciifier" which removes all non-ASCII characters in summaries and posts, thus mangling a lot of names, locations and math formulas.
1% APY, No fees, Online Bank https://captl1.co/2uIErYq Don't let your $$$ sit in a no-interest acct.
Question: What piece of code, in a non-assembler format, has been run the most often, ever, on this planet? By 'most often,' I mean the highest number of executions, regardless of CPU type.
Answer: Genetic code.
of the Windows NT kernel that hasn't changed since the 1990s?
"I don't know, therefore Aliens" Wafflebox1
How could this ever be more than a guess? How could it ever be determined, documented, or verified?
And for that matter, what is the definition of whether something is "the same" piece of code? For example, if the same source code compiles to different instructions on two platforms, are they running the same code?
How about if one of them actually compiles code that gets executed, and the other optimizes it out?
"How to Do Nothing," kids activities, back in print!
http://en.wikipedia.org/wiki/IEFBR14
Any time a mainframe does anything with a dataset in a batch job (i.e. allocate, delete, whatever) it runs IEFBR14, a null program, as a target program to satisfy a requirement in how jobs are created.
This means that banks, retailers, governments, you name it--when they process the back-end records that make modern life functional, IEFBR14 usually gets invoked somewhere.
printf("Hello, World!\n");
for(int i=0; iSOME_LENGTH; i++){
array[i] = 0;
}
Run 100s of times per program, for almost all programs
I still have more fans than freaks. WTF is wrong with you people?
eg. Call timer code in the 5ESS switch. Countless millions of times a day for over 30 years now. Probably the oldest code that we all depend on every day.
"To those who are overly cautious, everything is impossible. "
on anything {
displayHWinPtrAddrPtrScreen( {492EC5F8-477F-438E}.color.const::BLUE status:{492EC5F8-477F-438E}.const.DEATH } )
}
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
The keyboard scan loop in Windows gets my vote.
If it's not yet, it will be soon. At the moment the SHA-256 algorithm is being run in the neighborhood of 15,000,000,000,000,000 times per second by miners.
Violence is like duct tape. If it doesn't solve the problem, you didn't use enough.
static inline void B(void *blah, uint32_t a)
{
uint8_t * z = (uint8_t *)blah;
z[0] = (a >> 24) & 0xff;
z[1] = (a >> 16) & 0xff;
z[2] = (a >> 8) & 0xff;
z[3] = a & 0xff;
}
It’s not really executable as I understand it, but I am not a biologist. The translation from DNA to RNA is hard to construe as ‘execution’. Then in the next step the RNA goes to ribosomes to construct proteins. So maybe DNA is ‘compiled’?
The field of computational biology would probably have a good metaphor to map the ideas from biology to computer science.
Perhaps it would be better to say for most genes that you compile a protein from the DNA using a temporary (RNA) copy and your ribosomes as the compiler, and the protein is the executable version ... although the ribosomal RNA genes are the most ancient still used and among the few that few active components that are still used in RNA form (tRNAs as carriers probably would not count).
The counters in digital clocks have furiously been counting clock ticks to the next second since the '70s, if not earlier.
I do not fail; I succeed at finding out what does not work.
It's not compiled, it's interpreted. If you had a single gigantic mRNA consisting of all your genes, that would be compilation.
You can think of DNA as source (in an extremely low-level language), mRNA as machine code, and ribosomes as microcontrollers. DNA transcriptase interprets DNA into RNA. In eukaryotes, SNRPs are optimizers (written by a lunatic, but no analogy is perfect) that rearrange the RNA; ribosomes interpret the RNA.
You've got lots of ribosomes in each cell, so think of each cell as a massively multi-core architecture running a totally asynchronous program.
So what's the most frequently interpreted gene? Most likely something used by bacteria, since those are the most numerous cells on the planet. Or maybe a routine that's common to all cells. Something that regulates cell division?
Note that a lot of the stuff that cells do most frequently (say, transport a hydrogen ion across a membrane) does not require DNA synthesis each time. The instructions in DNA are in large part "build a machine out of protein"; there are also a lot of genes involved in *managing* the machine but not much involved in *operating* the machine, if you see what I'm driving at. Obviously, after cell division you need to synthesize more stuff to replace what you've lost (otherwise you'd shrink away to nothing after surprisingly few divisions), but you basically need to sythesize everything; I'm not sure one gene would stand out.
There are specialized cases where a cell needs to synthesize LOTS of something; salivary glands in insects for example make lots of extra copies of the genes for certain enzymes; some plants do something similar to synthesize various chemicals. But these cases are probably outnumbered by bacteria.
followed closely by...
Java.InstallUpdate()