Quote:Original post by willh
Quote:Original post by DaeraxIn practice you cannot know exactly what your computer is doing at all times these days. Less and less with multicore. |
I don't follow. I thought multicore had no impact at all on what a program was doing. I was under the impression that, unless you specifically designed your program to use multiple processors, the OS would treat your app just like it always has. |
The OS certainly isn't intelligent enough to automatically parallelize single-threaded code, so, yes, a single-threaded application will more-or-less run on a single core (or in the worst case, switch cores all the time, but it will never run on two or more cores simultaneously).
I believe Daerax meant that if one wants to actually utilize multiple cores, he or she needs to step into a very chaotic and nondeterministic world, and that harnessing the power of multiple cores correctly is extremely hard when using "regular languages" such as C++, java or C#, while when programming in a higher level language such as Prolog, Haskell, Oz or Erlang, a lot of complexity can be handled by the language/compiler, and writing a correctly behaving multi-threaded program can then become quite easy. For example, as far as I know, most Prolog programs (those who do not use the somewhat ugly assert/retract constructs) can be run on multiple cores with no change to the source code whatsoever.
(Directed towards "use any language you wish" posts) Languages are indeed "just tools", meaning there is no sense in claiming one language is absolutely superior to another. However, using the right language for the right problem can make a huge difference. Screwdrivers are not inherently better than forks, but they sure make it easier to put those screws in. There's more than one programming language for a reason.