<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=DE link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Yes Alan correct: I wrongly asumed ist a separate stack. So it is a non-issue.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I tried it out and having a doPriv(lambda) block shortens the possible overall thread dept by about 200 calls (with my simple stack usage).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>BTW: the main thread does behave a bit less predictable: (run results at end of file)</p><p class=MsoNormal>https://github.com/ecki/JavaSystemTest/blob/master/src/main/java/net/eckenfels/test/javasystemtest/StackDepth.java#L86</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Greetings</p><p class=MsoNormal>Bernd</p><p class=MsoNormal>-- <br>http://bernd.eckenfels.net</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>Von: </b><a href="mailto:Alan.Bateman@oracle.com">Alan Bateman</a><br><b>Gesendet: </b>Montag, 20. November 2017 22:02<br><b>An: </b><a href="mailto:ecki@zusammenkunft.net">Bernd Eckenfels</a>; <a href="mailto:security-dev@openjdk.java.net">OpenJDK Dev list</a><br><b>Betreff: </b>Re: Eliminating the security overhead when not running with asecuritymanager</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:black'>On 20/11/2017 20:15, Bernd Eckenfels wrote:<br><br><o:p></o:p></span></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span style='color:black'>:<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'> <o:p></o:p></span></p><p class=MsoNormal><span style='color:black'>One thing which might be a problem: when doPrivileged does no longer execute the Code in a seperate stack this has implications to the runtime. The stacks will get deeper (and might even overflow (more often)). So maybe this „no seperate stack“ function should be opt-out (if implemented).<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'><o:p> </o:p></span></p></blockquote><p class=MsoNormal><span style='color:black'>Are you assuming that the execution of the privileged action is done on a different thread stack? The effect of doPrivileged is to set the top of the privileged stack on the current thread stack, it gets restored when the action completes. So I think there isn't anything to be concerned about here.<br><br>-Alan<o:p></o:p></span></p><p class=MsoNormal><span style='color:black'><o:p> </o:p></span></p></div></body></html>