"Wilco Dijkstra" skrev i meddelandet news:C_vMh.3351$ snipped-for-privacy@newsfe3-win.ntli.net...
Lets see: to execute
we can assume the following assembler code:
lsld 1,r0 load mosi,r1 or r1,r0 waitfor eventflag_1 ; YES ; H/W to support event wait
So the multithreaded CPU will complete in 40 x 4 = 160 instructions
Id like to see a single threaded CPU doing this in 160 instructions.
I think an interrupt is probably 5-10 clocks and return from interrupt the same. So 10 clocks * 40 interrupts = 400 clocks to start with. I think you will run about 5 times slower. With more overhead for interrupts, much much slower.
No, because a proper multithreaded architecture releases the pipeline to computable threads when they do not need to be active.
If you do not need top performance in a single thread, you can greatly simplify the pipeline and thus increase the frequency of the CPU. You are able to mix programs from several sources on a single CPU instead of having several CPUs, because noone knows how to maintain code from different sources. Sometimes you don´t even get source of the firmware.
A classic example would be something implementing a V.22 modem in S/W. You can have the V.22 S/W running in a thread, and you cannot screw up the performance of the modem S/W. By allocating a certain number of MIPS and guaranteeing that the program is not stopped by application S/W running at high priority, you have solved the problem.
Another example: today you can get single chip GPS. To reduce cost, they are ROMmed, and you add an external microcontroller to do the user interface. At this stage, the ARM7 CPU running the GPS S/W needs about 20 MIPS, and there is no plan to let anyone touch the ARM, due to the sensitivity of the S/W.
With a multithreaded CPU you could allocate 20 MIPS for the GPS and run the application S/W on the remining MIPS.