Re: Are there real use cases with the Java access modes?

Andrew Haley via Concurrency-interest <[email protected]> Thu, 22 Jul 2021 09:33:01 +0100
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <[email protected]>
On 7/21/21 4:50 PM, Nathan Reynolds via Concurrency-interest wrote:

> Sounds like a job for a linter.  For easier cases, an easy PMD rule
> will catch such a problem.  For harder cases, the PMD rule will need
> to traverse the call tree to see if a thread executing the loop
> could change the field.  If not, flag a problem to the programmer.

I suspect that getting this right (no false positives or negatives) is
equivalent to the halting problem, i.e. it's uncomputable. The best
you can say is that if an expression used as the exit condition of a
loop has a term hoisted from memory, the loop might not terminate.

However, while linting for that provides some information to the naive
programmer, it "solves" the problem of infinite loops but ignores
silently returning false results.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest