Re: github

2018-05-31 Thread Ivan Krylov

Hi folks,

Apologies for wide distribution, this was meant to be a private mail.

Cheers,
Ivan

Since I am already making the noise - my question was about the sample 
code for article [1] which I found interesting and it is actually 
related to this alias.

Kudos to Per-Åke Minborg for the write-up and Tagir for the jmh test.

[1] - https://dzone.com/articles/creating-maps-with-named-lambdas

On 5/31/18 1:20 PM, Remi Forax wrote:

Hi Ivan,
we are not Tagir :)

The code is quite fun but i would not recommend to use that hack in real life.

Rémi

- Mail original -

De: "Ivan Krylov" 
À: "core-libs-dev" 
Envoyé: Mercredi 30 Mai 2018 22:48:39
Objet: github
Тагир, привет,

Слушай, а что с лицензией твоих примеров на гитхабе? Не мог бы ты
какую-то лицензию упомянуть в шапке?
Скажем, вот этот:
https://gist.github.com/amaembo/cbe9e1a8f3f8d240beb080343670f0c2

Спасибо,

Ваня





github

2018-05-30 Thread Ivan Krylov

Тагир, привет,

Слушай, а что с лицензией твоих примеров на гитхабе? Не мог бы ты 
какую-то лицензию упомянуть в шапке?
Скажем, вот этот: 
https://gist.github.com/amaembo/cbe9e1a8f3f8d240beb080343670f0c2


Спасибо,

Ваня



Re: RFR(XS): 8147844: new method j.l.Thread.onSpinWait() (was j.l.Runtime)

2016-03-09 Thread Ivan Krylov

Hi David,

I looked around for more examples and adopted both of your suggestions.

New javadoc (should look like the one before except for the horizontal line)
http://cr.openjdk.java.net/~ikrylov/8147844.doc.01/java/lang/Thread.html#onSpinWait-- 



I replaced the webrev in place again:
http://cr.openjdk.java.net/~ikrylov/8147844.jdk.03

Thanks,

Ivan


On 09/03/2016 17:36, David Holmes wrote:

Hi Ivan,

On 10/03/2016 8:26 AM, Ivan Krylov wrote:
I have added a little example that hopefully explains what the new 
method

is for

JavaDoc:
http://cr.openjdk.java.net/~ikrylov/8147844.doc.00/java/lang/Thread.html#onSpinWait-- 



I replaced the webrev in place:
http://cr.openjdk.java.net/~ikrylov/8147844.jdk.03


That seems fine to me textually. Thanks for adding the usage example.

In terms of the HTML I think onSpinWait should be 
replaced by {@code onSpinWait}. Also the whole chunk of code in the 
 section should(?) also be in a {@code ie:


  * {@code
  * class EventHandler {
  ...
  * }
  * }

I note that the Thread javadoc doesn't currently utilize {@code }, but 
I don't think it should fall to this change to rectify that.


Thanks,
David


Thanks,

Ivan


On 07/03/2016 17:40, David Holmes wrote:

Hi Ivan,

On 8/03/2016 11:04 AM, Ivan Krylov wrote:

The current wording of what is being called now JEP-285 [1] has placed
onSpinWait() method into j.l.Thread.
Hence, a new revision of the webrev. Everything is the same, except 
now

it is the Thread class.

http://cr.openjdk.java.net/~ikrylov/8147844.jdk.03/


Make sure the commit comment reflects the new synopsis :)

I thought at some point there was discussion of giving a usage example
in the javadoc? I think most people would be quite puzzled after
reading the technical spec alone.

Thanks,
David


Please, approve.

Thanks,

Ivan

[1] - openjdk.java.net/jeps/285

On 27/01/2016 09:53, Ivan Krylov wrote:

Updated to http://cr.openjdk.java.net/~ikrylov/8147844.jdk.02/
The sample JavaDoc has been updated too:
http://ivankrylov.github.io/onspinwait/api/java/lang/Runtime.html#onSpinWait-- 





Alan, Thank you.

On 27/01/2016 18:20, Alan Bateman wrote:



On 27/01/2016 14:10, Ivan Krylov wrote:

Indeed, thanks!
New webrev http://cr.openjdk.java.net/~ikrylov/8147844.jdk.01/


Can you add @since 9 too?

-Alan.










Re: RFR(XS): 8147844: new method j.l.Thread.onSpinWait() (was j.l.Runtime)

2016-03-09 Thread Ivan Krylov
To me this is an implementation detail that could change. The barrier is 
there to prevent the intrinsic to be hoisted.


Thanks,
Ivan



On 09/03/2016 17:50, Vitaly Davidovich wrote:
Is it worthwhile to mention ordering effects? In particular, I believe 
there's a compiler barrier preventing moving ops before the call.  Not 
sure if this needs any attention in the javadoc.


On Wednesday, March 9, 2016, Ivan Krylov <mailto:i...@azulsystems.com>> wrote:


I have added a little example that hopefully explains for the new
method is for

JavaDoc:

http://cr.openjdk.java.net/~ikrylov/8147844.doc.00/java/lang/Thread.html#onSpinWait--

<http://cr.openjdk.java.net/%7Eikrylov/8147844.doc.00/java/lang/Thread.html#onSpinWait-->
I replaced the webrev in place:
http://cr.openjdk.java.net/~ikrylov/8147844.jdk.03
<http://cr.openjdk.java.net/%7Eikrylov/8147844.jdk.03>

Thanks,

Ivan


On 07/03/2016 17:40, David Holmes wrote:

Hi Ivan,

    On 8/03/2016 11:04 AM, Ivan Krylov wrote:

The current wording of what is being called now JEP-285
[1] has placed
onSpinWait() method into j.l.Thread.
Hence, a new revision of the webrev. Everything is the
same, except now
it is the Thread class.

http://cr.openjdk.java.net/~ikrylov/8147844.jdk.03/
<http://cr.openjdk.java.net/%7Eikrylov/8147844.jdk.03/>


Make sure the commit comment reflects the new synopsis :)

I thought at some point there was discussion of giving a usage
example in the javadoc? I think most people would be quite
puzzled after reading the technical spec alone.

Thanks,
David

Please, approve.

Thanks,

Ivan

[1] - openjdk.java.net/jeps/285
<http://openjdk.java.net/jeps/285>

    On 27/01/2016 09:53, Ivan Krylov wrote:

Updated to
http://cr.openjdk.java.net/~ikrylov/8147844.jdk.02/
<http://cr.openjdk.java.net/%7Eikrylov/8147844.jdk.02/>
The sample JavaDoc has been updated too:

http://ivankrylov.github.io/onspinwait/api/java/lang/Runtime.html#onSpinWait--



Alan, Thank you.

On 27/01/2016 18:20, Alan Bateman wrote:



    On 27/01/2016 14:10, Ivan Krylov wrote:

Indeed, thanks!
New webrev
http://cr.openjdk.java.net/~ikrylov/8147844.jdk.01/
<http://cr.openjdk.java.net/%7Eikrylov/8147844.jdk.01/>

Can you add @since 9 too?

-Alan.






--
Sent from my phone




Re: RFR(XS): 8147844: new method j.l.Thread.onSpinWait() (was j.l.Runtime)

2016-03-09 Thread Ivan Krylov
I have added a little example that hopefully explains for the new method 
is for


JavaDoc: 
http://cr.openjdk.java.net/~ikrylov/8147844.doc.00/java/lang/Thread.html#onSpinWait--
I replaced the webrev in place: 
http://cr.openjdk.java.net/~ikrylov/8147844.jdk.03


Thanks,

Ivan


On 07/03/2016 17:40, David Holmes wrote:

Hi Ivan,

On 8/03/2016 11:04 AM, Ivan Krylov wrote:

The current wording of what is being called now JEP-285 [1] has placed
onSpinWait() method into j.l.Thread.
Hence, a new revision of the webrev. Everything is the same, except now
it is the Thread class.

http://cr.openjdk.java.net/~ikrylov/8147844.jdk.03/


Make sure the commit comment reflects the new synopsis :)

I thought at some point there was discussion of giving a usage example 
in the javadoc? I think most people would be quite puzzled after 
reading the technical spec alone.


Thanks,
David


Please, approve.

Thanks,

Ivan

[1] - openjdk.java.net/jeps/285

On 27/01/2016 09:53, Ivan Krylov wrote:

Updated to http://cr.openjdk.java.net/~ikrylov/8147844.jdk.02/
The sample JavaDoc has been updated too:
http://ivankrylov.github.io/onspinwait/api/java/lang/Runtime.html#onSpinWait-- 




Alan, Thank you.

On 27/01/2016 18:20, Alan Bateman wrote:



On 27/01/2016 14:10, Ivan Krylov wrote:

Indeed, thanks!
New webrev http://cr.openjdk.java.net/~ikrylov/8147844.jdk.01/


Can you add @since 9 too?

-Alan.








Re: RFR(XS): 8147844: new method j.l.Thread.onSpinWait() (was j.l.Runtime)

2016-03-07 Thread Ivan Krylov

On 07/03/2016 17:40, David Holmes wrote:

Hi Ivan,

On 8/03/2016 11:04 AM, Ivan Krylov wrote:

The current wording of what is being called now JEP-285 [1] has placed
onSpinWait() method into j.l.Thread.
Hence, a new revision of the webrev. Everything is the same, except now
it is the Thread class.

http://cr.openjdk.java.net/~ikrylov/8147844.jdk.03/


Make sure the commit comment reflects the new synopsis :)

Yes, indeed, noticed this too late or sent to early.
Fixed in place.

I thought at some point there was discussion of giving a usage example 
in the javadoc? I think most people would be quite puzzled after 
reading the technical spec alone.
Ok, I will add something like an example once I figure out the javadoc 
syntax. Will post here when done.


Thanks,

Ivan




Thanks,
David


Please, approve.

Thanks,

Ivan

[1] - openjdk.java.net/jeps/285

On 27/01/2016 09:53, Ivan Krylov wrote:

Updated to http://cr.openjdk.java.net/~ikrylov/8147844.jdk.02/
The sample JavaDoc has been updated too:
http://ivankrylov.github.io/onspinwait/api/java/lang/Runtime.html#onSpinWait-- 




Alan, Thank you.

On 27/01/2016 18:20, Alan Bateman wrote:



On 27/01/2016 14:10, Ivan Krylov wrote:

Indeed, thanks!
New webrev http://cr.openjdk.java.net/~ikrylov/8147844.jdk.01/


Can you add @since 9 too?

-Alan.








Re: RFR(XS): 8147844: new method j.l.Thread.onSpinWait() (was j.l.Runtime)

2016-03-07 Thread Ivan Krylov
The current wording of what is being called now JEP-285 [1] has placed 
onSpinWait() method into j.l.Thread.
Hence, a new revision of the webrev. Everything is the same, except now 
it is the Thread class.


http://cr.openjdk.java.net/~ikrylov/8147844.jdk.03/

Please, approve.

Thanks,

Ivan

[1] - openjdk.java.net/jeps/285

On 27/01/2016 09:53, Ivan Krylov wrote:

Updated to http://cr.openjdk.java.net/~ikrylov/8147844.jdk.02/
The sample JavaDoc has been updated too: 
http://ivankrylov.github.io/onspinwait/api/java/lang/Runtime.html#onSpinWait--


Alan, Thank you.

On 27/01/2016 18:20, Alan Bateman wrote:



On 27/01/2016 14:10, Ivan Krylov wrote:

Indeed, thanks!
New webrev http://cr.openjdk.java.net/~ikrylov/8147844.jdk.01/


Can you add @since 9 too?

-Alan.






Re: [concurrency-interest] Spin Loop Hint support: Draft JEP proposal

2016-02-24 Thread Ivan Krylov

On 24/02/2016 18:56, mark.reinh...@oracle.com wrote:

2016/2/23 22:22 -0800, Gil Tene :

...

Let's just go with it.

Thread.onSpinWait() FTW!

I agree.  The "on" prefix is not exclusively reserved for APIs that
deliver event objects, and in this context it clarifies the meaning
of the method.

- Mark

I have updated the JEP: https://bugs.openjdk.java.net/browse/JDK-8147832


Re: [concurrency-interest] Spin Loop Hint support: Draft JEP proposal

2016-02-24 Thread Ivan Krylov

On 24/02/2016 18:20, Vitaly Davidovich wrote:
If you want, run a poll to get a better feel for what others may 
think. Doug did that recently for some CompletableFuture behavior 
change proposals. Ultimately, I don't make the call on this anyway so 
I'm just giving you my opinion as a would-be user of this API. 
This discussion has been going on for nearly half of a year, everyone is 
saying "I don't care for the name, but..".
Another poll will not do any good. I would rather have a Project Lead to 
make a final decision on the API, a harmless one either way IMO.


Ivan



Re: RFR(XS): 8147844: new method j.l.Runtime.onSpinWait()

2016-01-27 Thread Ivan Krylov

Updated to http://cr.openjdk.java.net/~ikrylov/8147844.jdk.02/
The sample JavaDoc has been updated too: 
http://ivankrylov.github.io/onspinwait/api/java/lang/Runtime.html#onSpinWait--


Alan, Thank you.

On 27/01/2016 18:20, Alan Bateman wrote:



On 27/01/2016 14:10, Ivan Krylov wrote:

Indeed, thanks!
New webrev http://cr.openjdk.java.net/~ikrylov/8147844.jdk.01/


Can you add @since 9 too?

-Alan.




Re: RFR(XS): 8147844: new method j.l.Runtime.onSpinWait()

2016-01-27 Thread Ivan Krylov

Indeed, thanks!
New webrev http://cr.openjdk.java.net/~ikrylov/8147844.jdk.01/

On 27/01/2016 16:48, Andrej Golovnin wrote:

Hi Ivan,


Please review the upcoming API changes:
http://cr.openjdk.java.net/~ikrylov/8147844.jdk.00/

I think the semicolon at the end of the line 887 is not needed, e.g:

887 public static void onSpinWait() {};

should be

887 public static void onSpinWait() {}

Best regards,
Andrej Golovnin




RFR(XS): 8147844: new method j.l.Runtime.onSpinWait()

2016-01-27 Thread Ivan Krylov

Hello,

Earlier there was a discussion on this mail alias about the spin loop 
hint proposal [1]. Based on the feedback from that discussion some 
changes were incorporated and the JEP has been filed [2]. There seems to 
be a consensus on the API side. The JEP is now in a draft state and I 
hope this JEP will get targeted for java 9 shortly.


Please review the upcoming API changes:
http://cr.openjdk.java.net/~ikrylov/8147844.jdk.00/

For the reference, the new generated JavaDoc for j.l.Runtime class and 
the new method

http://ivankrylov.github.io/onspinwait/api/java/lang/Runtime.html#onSpinWait--

Thanks,

Ivan

1 - 
http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-October/thread.html#35613

2 - https://bugs.openjdk.java.net/browse/JDK-8147832.


Re: Spin Loop Hint support: Draft JEP proposal

2015-10-05 Thread Ivan Krylov



Is this some kind of CPU.yield() (by analogy to Thread.yield())?


I was wondering the same, it feels like a more vague (API abstraction-wise at 
least) architecture specific Thread.yield().

Paul.


Thread.sleep(0), Thread.yield() and now PerformanceHints.spinLoopHint() 
are all implementation specific.
Furthermore, Intel [1] says " The execution of the next instruction is 
delayed for an implementation-specific amount of time."

Can be a nop (and is a nop on old CPUs), can be something else.

[1] - https://software.intel.com/en-us/node/524249





Re: Spin Loop Hint support: Draft JEP proposal

2015-10-05 Thread Ivan Krylov

On 05/10/2015 11:56, Aleksey Shipilev wrote:
* I think spinLoopHint() misses a @HotspotIntrinsicCandidate 
annotation. Thanks, -Aleksey 
Correct. This prototype was build a little while ago and was based on 
OpenJDK 9 build 70.
This annotation was added as part of 
https://bugs.openjdk.java.net/browse/JDK-8076112 in build 74.


Thanks,

Ivan