Serge,
psurge said:
I have to disagree. writing multi-threaded programs is hard, even using a language like Java which has some language support for threads.
writing multi-threaded code is harder than writing single-threaded. no doubt about that. but so is solving differential equations compared to 1st grade algebra. does it mean we can stick to 1st grade algebra? hardly. now, how much more difficult is developing multithreaded code to singlethreaded is a tricky question.
see, as with most things in human life, one needs to get sufficient 'exposure' to something to start feeling comfortable when dealing with it. respectively, if one sticks to single-threaded code awaiting for a good-enough language to occur which would do all concurrencies splitting and synchronisation for him, well, he may not have that chance in his lifetime. no?
as for what takes for a procedural language to be multi-threading-capable -- threads (or parallelism per say) need very little support by the language itself to be viable at all. what it takes is essentially a hint for the compiler that a given object (in OOP terms) is a subject to 'external' changes, i.e. its 'value' should not be assumed or cached. the rest in multithreading is good os support.
I would say it is inherently harder than single threaded programs, and requires a mental paradigm shift for coders, who mostly are used to writing single threaded applications. (IMO people mostly think in "single-threaded" fashion as well).
actually, we don't quite know yet how people think. human brain is an enournous neuron network, so it hardly does anything 'single-threaded'-ly, excep for the very top layer of consciousness, but that's delving into other spheres. what we can safely say is that 'people are mosty
used to single-threaded laying out of algorithms.' which states almost nothing about what people could be taught.
C,C++, and even Java do nothing to clearly express paralellism, multi-threaded program behaviour, or effects of having multiple threads running the same code in the source text. They do not provide ways of managing/scheduling parallel subtasks. They do not address issues like exception handling in a multi-threaded program where the program state at any given time is non-deterministic, or how threads communicate/pass data between each-other.
check out ADA - you may find it does many of the things you deem necessary.
That, IMO is what makes multi-threaded debugging very hard, regardless of what tool you are using.
the debugging tools i use under the pervasive multi-threading os i run at home do anything i need for the purpose. apparently we have different ideas of what each of us deems necessary for the purpose.
I think someone needs to produce a language which enables a coder to specify parallelism using the language :
i.e. be able to translate "I want calculation X to be performed for objects Y, each calculation is independant of anything else going on" to clean code.
a programming language does not need to fit the alpha and omega of your
abstraction needs (as there's hardly a limit to them), it just has to have the reasonable minimum(tm), the rest is up to the people who use it.