Eric G. Miller wrote: > On Sat, Dec 14, 2002 at 08:46:43PM -0800, Craig Dickson wrote: > > > Yes, but the question is, how usable is it in practice? > [snip] > > People use "tasks" in Ada on a regular basis. So, it must be usable, > neigh?
By the same reasoning, concurrency support in C and C++ must be really great, because there are lots of multithreaded programs written in those languages. I've written many myself. Yet, in fact, there is no concurrency support at all in those languages. > 3 > * a call on a protected subprogram of a protected object, providing > exclusive read-write access, or concurrent read-only access to > shared data; What makes a subprogram "protected"? Is this a keyword or something that the programmer has to put in the right place, like Java's "synchronized"? > 8 > In addition, tasks can communicate indirectly by reading and > updating (unprotected) shared variables, presuming the access is > properly synchronized through some other kind of task interaction. This sounds like "thread synchronization is the programmer's problem", at least for the case of unprotected variables. This all sounds considerably more portable than C threading (which is dependent either on calling OS services directly, or using a third-party library that may not be available on all platforms, or may have licensing issues), but not necessarily all that much better. The crucial point, to me, is that for at least the most common kinds of thread communication and data sharing, it should not be necessary for the programmer to remember to do anything extra (like mark functions or variables with a special thread-safety keyword). Erlang meets this requirement in spades; I don't know of another language that does. Craig
msg19236/pgp00000.pgp
Description: PGP signature