[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] Fwd: Re: <Swing Dev> [11] JDK-8153732: Windows remote printer changes do not reflec
From:       Philip Race <philip.race () oracle ! com>
Date:       2018-06-21 0:07:35
Message-ID: 5B2AEC47.8030107 () oracle ! com
[Download RAW message or body]

The main concern I have is we now have a busy thread burning CPU ..
bad for laptops .. and if we add a delay we have less prompt notification
of a new local printer.

I think the compromise is that the existing thread maybe kept as is,
and we add a new thread that pools every 10 minutes for a remote printer.

If we can make the existing thread wake up from its wait and do that, 
even better.

-phil.

-------- Original Message --------
Subject: 	Re: [11] JDK-8153732: Windows remote printer changes do not 
reflect in lookupPrintServices()
Date: 	Wed, 20 Jun 2018 17:03:56 -0700
From: 	Philip Race <philip.race@oracle.com>
Organization: 	Oracle Corporation
To: 	Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah@oracle.com>
CC: 	awt-dev@openjdk.java.net, swing-dev@openjdk.java.net



This is on the wrong lists. Not Swing. Not AWT. Should be 2d.
I'll forward it there and continue there. Consider the AWT+Swing threads 
dead.

-phil.

On 6/20/18, 3:12 AM, Shashidhara Veerabhadraiah wrote:
>
> Hi All, Please review this code changes for the below enhancement.
>
> Enhancement: https://bugs.openjdk.java.net/browse/JDK-8153732
>
> Webrev: http://cr.openjdk.java.net/~sveerabhadra/8153732/webrev.00/ 
> <http://cr.openjdk.java.net/%7Esveerabhadra/8153732/webrev.00/>
>
> Details of the changes: Windows provides *PrinterChangeNotification* 
> functions that provides information about printer status changes of 
> the local printers(subset) but not network printers.
> Alternatively, Windows provides a way thro' which one can get the 
> network printer status changes by using WMI, RegistryKeyChange 
> combination, which is a slightly complex mechanism.
> The Windows WMI offers an async and sync method to read thro' registry 
> via the WQL query. The async method is considered dangerous as it 
> leaves open a channel until we close it. But the async method has the 
> advantage of being notified of a change in registry by calling 
> callback without polling for it. The sync method uses the polling 
> mechanism to notify.
> RegistryValueChange cannot be used in combination with WMI to get 
> registry value change notification because of an error that may be 
> generated because the scope of the query would be too big to handle(at 
> times).
> Hence an alternative mechanism is choosen via the EnumPrinters by 
> polling for the count of printer status changes(add\remove) and based 
> on it update the printers list(both local and remote printers - superset).
>
> Thanks and regards,
>
> Shashi
>

[Attachment #3 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    The main concern I have is we now have a busy thread burning CPU ..<br>
    bad for laptops .. and if we add a delay we have less prompt
    notification<br>
    of a new local printer.<br>
    <br>
    I think the compromise is that the existing thread maybe kept as is,<br>
    and we add a new thread that pools every 10 minutes for a remote
    printer.<br>
    <br>
    If we can make the existing thread wake up from its wait and do
    that, even better.<br>
    <br>
    -phil.<br>
    <br>
    -------- Original Message --------
    <table class="moz-email-headers-table" border="0" cellpadding="0"
      cellspacing="0">
      <tbody>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject: </th>
          <td>Re: <swing dev=""> [11] JDK-8153732: Windows remote
              printer changes do not reflect in lookupPrintServices()</swing></td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
          <td>Wed, 20 Jun 2018 17:03:56 -0700</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
          <td>Philip Race <a class="moz-txt-link-rfc2396E" \
href="mailto:philip.race@oracle.com">&lt;philip.race@oracle.com&gt;</a></td>  </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Organization:
          </th>
          <td>Oracle Corporation</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
          <td>Shashidhara Veerabhadraiah
            <a class="moz-txt-link-rfc2396E" \
href="mailto:shashidhara.veerabhadraiah@oracle.com">&lt;shashidhara.veerabhadraiah@oracle.com&gt;</a></td>
  </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">CC: </th>
          <td><a class="moz-txt-link-abbreviated" \
href="mailto:awt-dev@openjdk.java.net">awt-dev@openjdk.java.net</a>, <a \
class="moz-txt-link-abbreviated" \
href="mailto:swing-dev@openjdk.java.net">swing-dev@openjdk.java.net</a></td>  </tr>
      </tbody>
    </table>
    <br>
    <br>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    This is on the wrong lists. Not Swing. Not AWT. Should be 2d.<br>
    I'll forward it there and continue there. Consider the AWT+Swing
    threads dead.<br>
    <br>
    -phil.<br>
    <br>
    On 6/20/18, 3:12 AM, Shashidhara Veerabhadraiah wrote:
    <blockquote cite="mid:afa12391-489d-4997-b2b8-9925a36cf756@default"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
	{font-family:PMingLiU;
	panose-1:2 1 6 1 0 1 1 1 1 1;}
@font-face
	{font-family:Tunga;
	panose-1:0 0 4 0 0 0 0 0 0 0;}
@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;}
@font-face
	{font-family:"\@PMingLiU";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi All, Please review this code changes for
          the below enhancement.<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Enhancement: <a moz-do-not-send="true"
            href="https://bugs.openjdk.java.net/browse/JDK-8153732">https://bugs.openjdk.java.net/browse/JDK-8153732</a><o:p></o:p></p>
  <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Webrev: <a moz-do-not-send="true"
            href="http://cr.openjdk.java.net/%7Esveerabhadra/8153732/webrev.00/">http://cr.openjdk.java.net/~sveerabhadra/8153732/webrev.00/</a><o:p></o:p></p>
  <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Details of the changes: Windows provides
          *PrinterChangeNotification* functions that provides
          information about printer status changes of the local
          printers(subset) but not network printers.&nbsp;<br>
          Alternatively, Windows provides a way thro' which one can get
          the network printer status changes by using WMI,
          RegistryKeyChange combination, which is a slightly complex
          mechanism.&nbsp;<br>
          The Windows WMI offers an async and sync method to read thro'
          registry via the WQL query. The async method is considered
          dangerous as it leaves open a channel until we close it. But
          the async method has the advantage of being notified of a
          change in registry by calling callback without polling for
          it.&nbsp;The sync method uses the polling mechanism to notify.&nbsp;<br>
          RegistryValueChange cannot be used in combination with WMI to
          get registry value change notification because of an error
          that may be generated because the scope of the query would be
          too big to handle(at times).&nbsp;<br>
          Hence an alternative mechanism is choosen via the EnumPrinters
          by polling for the count of printer status changes(add\remove)
          and based on it update the printers list(both local and remote
          printers - superset).<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Thanks and regards,<o:p></o:p></p>
        <p class="MsoNormal">Shashi<o:p></o:p></p>
      </div>
    </blockquote>
  </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic