[concurrency-interest] The code example in onSpinWait() Javadoc
leventov.ru at gmail.com
Fri Nov 15 10:55:07 EST 2019
I agree that Javadoc code shouldn't be a tutorial - that is why I also
proposed to delete the example completely. But I think the current example
is a little bit of anti-tutorial. To cite Josh Bloch - "Example code should
be exemplary. If an API is used widely, its examples will be the archetypes
for thousands of programs. Any mistakes will come back to haunt you a
On Fri, 15 Nov 2019 at 18:04, Andrew Haley via Concurrency-interest <
concurrency-interest at cs.oswego.edu> wrote:
> On 11/15/19 1:31 PM, Alex Otenko via Concurrency-interest wrote:
> > I am not arguing. I want to see justification for wanting something that
> > looks like a solution to an intractable problem.
> > I see onSpinWait as an indicator to the JVM that it can do something
> > useful, like possibly help FJP make some progress. I can't see how a time
> > bound can be enforced there.
> But that is not what "onSpinWait" means, that is what "yield" means.
> The idea of "onSpinWait" is to reduce latency in spin loops, where
> latency is measured in tens of nanoseconds. "onSpinWait" is not
> supposed to free the processor to do something else.
> I don't think there's anything much wrong with the example in the Javadoc,
> and the Javadoc is not supposed to be a tutorial.
> Andrew Haley (he/him)
> Java Platform Lead Engineer
> Red Hat UK Ltd. <https://www.redhat.com>
> EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest