PageRenderTime 36ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/bin/try/ahkstdlib/doc/Affinity.html

http://myhotkey.googlecode.com/
HTML | 105 lines | 82 code | 21 blank | 2 comment | 0 complexity | b1e960a2414c29f95ffe84c20ebbe060 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, LGPL-3.0, BSD-2-Clause
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html dir="ltr"><head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  4. <meta http-equiv="Content-Style-Type" content="text/css">
  5. <link rel="prev" href="http://www.autohotkey.com/forum/viewtopic.php?t=8728&amp;view=previous" title="View previous topic">
  6. <link rel="next" href="http://www.autohotkey.com/forum/viewtopic.php?t=8728&amp;view=next" title="View next topic">
  7. <link rel="up" href="http://www.autohotkey.com/forum/viewforum.php?f=2" title="Scripts &amp; Functions">
  8. <link rel="chapter forum" href="http://www.autohotkey.com/forum/viewforum.php?f=1" title="Ask for Help">
  9. <link rel="chapter forum" href="http://www.autohotkey.com/forum/viewforum.php?f=2" title="Scripts &amp; Functions">
  10. <link rel="chapter forum" href="http://www.autohotkey.com/forum/viewforum.php?f=3" title="Bug Reports">
  11. <link rel="chapter forum" href="http://www.autohotkey.com/forum/viewforum.php?f=4" title="Wish List">
  12. <link rel="chapter forum" href="http://www.autohotkey.com/forum/viewforum.php?f=6" title="Announcements">
  13. <link rel="chapter forum" href="http://www.autohotkey.com/forum/viewforum.php?f=7" title="Utilities &amp; Resources">
  14. <link rel="chapter forum" href="http://www.autohotkey.com/forum/viewforum.php?f=5" title="General Chat">
  15. <title>AHK Functions : FileMD5() / MD5() [Updated]</title>
  16. <link rel="alternate" type="application/rss+xml" title="AutoHotkey Forum RSS" href="http://www.autohotkey.com/forum/rss.php">
  17. <link rel="stylesheet" type="text/css" href="Affinity-Dateien/index.css" media="all">
  18. </head><body bgcolor="#e5e5e5" link="#006699" text="#000000" vlink="#5493b4">
  19. <table align="center" border="0" cellpadding="10" cellspacing="0" width="100%">
  20. <tbody>
  21. <tr>
  22. <td class="bodyline">
  23. <table class="forumline" border="0" cellpadding="3" cellspacing="1" width="100%">
  24. <tbody>
  25. <tr>
  26. <td class="row1" height="28" valign="top" width="100%">
  27. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  28. <tbody>
  29. <tr>
  30. <td colspan="2">
  31. <table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
  32. <tbody>
  33. <tr>
  34. <td class="quote">
  35. <!--DOCUMENT_FRAGMENT-->
  36. <span style="color: green;"><span style="font-size: 18px; line-height: normal;"><span style="font-weight: bold;">Affinity_Set()</span></span></span>
  37. <br>
  38. <br>
  39. <span style="font-size: 12px; line-height: normal;">Sets the CPU to be
  40. used in Dual/Quad/Multi core processors / Effectively, this function
  41. allows you to choose which AHK script uses what <br>
  42. processor.
  43. <br>
  44. <br>
  45. <span style="font-weight: bold;">Usage:</span> Use <span style="font-weight: bold;">Affinity_Set( n )</span> on the top of your script, where <span style="font-weight: bold;">n</span> will be <span style="font-weight: bold;">1</span> if you want the script to use the first processor, <span style="font-weight: bold;">2</span> if you want the script to use the second processor.. and <span style="font-weight: bold;">3</span> to utilise both of them
  46. <br>
  47. <br>
  48. <span style="font-weight: bold;">MSDN</span> Links: <a href="http://msdn.microsoft.com/en-us/library/ms686223%28VS.85%29.aspx" target="_top" class="postlink"><span style="color: blue;"><span style="text-decoration: underline;"><span style="font-weight: bold;">SetProcessAffinityMask</span></span></span></a> <span style="font-weight: bold;">,</span> <a href="http://msdn.microsoft.com/en-us/library/ms683213%28VS.85%29.aspx" target="_top" class="postlink"><span style="color: blue;"><span style="text-decoration: underline;"><span style="font-weight: bold;">GetProcessAffinityMask</span></span></span></a>
  49. <br>
  50. <br>
  51. <br>
  52. Some old applications do not run properly when run with dual/multi core
  53. mode and require the Affinity to be set to a single processor.
  54. <br>
  55. Here is an example to set Affinity manually: To set the Affinity for <span style="font-weight: bold;">Calculator</span>, start the Windows Task Manager, find the process <span style="font-weight: bold;">Calc.exe</span>, right click and select Affinity, and set the affinity by checking on/off the relevant CPU's.
  56. <br>
  57. <br>
  58. <ul><img src="Affinity-Dateien/wintaskmgr.png" border="0"><span style="color: white;">___________</span><img src="Affinity-Dateien/procaff.png" border="0"></ul>
  59. <br>
  60. <br>
  61. To achieve the same programmatically,
  62. <br>
  63. <br>
  64. </span><table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr> <td><span class="genmed"><b>Code:</b></span></td> </tr> <tr> <td class="code"><div>Process, Exist, calc.exe<br>PID := errorLevel<br>Affinity_Set( 3, PID ) <span style="color: rgb(0, 128, 0);">; presuming Affinity.ahk is available in User Library</span><br></div></td> </tr></tbody></table><span class="postbody">
  65. <br>
  66. </span>
  67. <!--/DOCUMENT_FRAGMENT-->
  68. </td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. </td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. </td>
  77. </tr>
  78. </tbody>
  79. </table>
  80. </td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. </body></html>