Re: Are there real use cases with the Java access modes?
Andrew Dinn via Concurrency-interest <[email protected]> Tue, 20 Jul 2021 11:41:21 +0100
| Newsgroups | gmane.comp.java.jsr.166-concurrency |
|---|---|
| Message-ID | <[email protected]> |
On 19/07/2021 22:39, Gregg Wonderly via Concurrency-interest wrote:
> Thanks for you comments. I am still trying to assert that the problem
> is this kind of assumption about people writing the code, actually being
> trained software engineers. Instead, think of them as self taught
> coders. People who only every wrote “basic” or “vb” style integrations
> with just some knowledge that threads even exist, let alone, as in this
> case, knowing that the AWT event queue is involved and that there are
> threads (or more in the case of dialogs and other blocking actions)
> reaping events from the queue and dispatching them into your code. Even
> the term callback or listener, for these people, doesn’t invoke any
> picture of “two” things working together.
And I am still trying to assert that we should not hobble the language
implementation to cater for that category of 'programmer' (rabbit ears
de rigeur). Java has been specified and implemented for use by skilled
and knowledgeable professionals. That includes knowing about and having
the skill to deal with the presence of multi-threading as a core element
of the language, with all its attendant complexities.
Of course, as a Java implementor I make no assumption that all those who
use Java will be skilled, knowledgeable professionals. What I do assume
is that I don't have to take the concerns or failings of unskilled or
ignorant 'would-be' coders into account.
By the way, I believe you are having your cake and eating it in the way
you present your arguments here. You cited an example program as simple
to understand and behaving as expected until you remove some logging
code to simplify it and suddenly ... oh,. how surprising, a non-volatile
access gets hoisted! At which point this simple to understand code
becomes incomprehensible to the average reader.
In truth, if you know how to read the different versions of this code
with an awareness that Java is a multi-threaded language the complexity
is never absent. The surprise you describe is prima facie evidence that
your posited average reader is not reading the code correctly, whether
in the original or reduced version. They just think they understand it.
regards,
Andrew Dinn
-----------
Red Hat Distinguished Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill
_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest