{ "subject": "Re: bitcoin auto-renice-ing", "content": { "format": "html", "body": "<div class=\"post\">It sets different priorities for each thread. &nbsp;The generate threads run at PRIO_MIN. &nbsp;The other threads rarely take any CPU and run at normal.<br/><br/>#define THREAD_PRIORITY_LOWEST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PRIO_MIN<br/>#define THREAD_PRIORITY_BELOW_NORMAL &nbsp; &nbsp;2<br/>#define THREAD_PRIORITY_NORMAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0<br/><br/>The priorities converted from Windows priorities were probably from a table like this:<br/><br/>&nbsp;&nbsp; \"The following table shows the mapping between nice values and Win32 priorities. Refer to the Win32 documentation for SetThreadPriority() for more information on Win32 priority issues.<br/><br/>nice value &nbsp;&nbsp;&nbsp;Win32 Priority<br/>-20 to -16 &nbsp;&nbsp;&nbsp;THREAD_PRIORITY_HIGHEST<br/>-15 to -6 &nbsp;&nbsp;&nbsp;THREAD_PRIORITY_ABOVE_NORMAL<br/>-5 to +4 &nbsp;&nbsp;&nbsp;THREAD_PRIORITY_NORMAL<br/>+5 to +14 &nbsp;&nbsp;&nbsp;THREAD_PRIORITY_BELOW_NORMAL<br/>+15 to +19 &nbsp;&nbsp;&nbsp;THREAD_PRIORITY_LOWEST\"<br/><br/>If you have better values, suggestions welcome.<br/><br/>Also, there was some advice on the web that PRIO_PROCESS is used on Linux because threads are processes. &nbsp;If that's not true, maybe it accounts for unexpectedly setting the priority of the whole app.<br/><br/>&nbsp;&nbsp; &nbsp;// threads are processes on linux, so PRIO_PROCESS affects just the one thread<br/>&nbsp;&nbsp; &nbsp;setpriority(PRIO_PROCESS, getpid(), nPriority);<br/></div>" }, "source": { "name": "Bitcoin Forum", "url": "https://bitcointalk.org/index.php?topic=72.msg717#msg717" }, "date": "2010-03-15T18:44:12Z" }
Inscription number 18,209,149
Genesis block 799,364
File type json
File size 2.1 KB
Creation date