Bitcoin Forum
November 13, 2026, 04:53:02 PM *
News: Latest Bitcoin Core release: 32.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Bitcoin Technical Support / bitcoind - possibly process priority bug? on: July 12, 2010, 08:20:34 AM
This is kind of a continuation of this thread : http://bitcointalk.org/index.php?topic=72.0

I believe there might be a misunderstanding regarding the code for changing the process priorities... basically in short, I believe the intention is to set the processes to lowest priority (meaning most non intrusive, least priority in cpu scheduling) when the thread generating coins as it is very CPU intensive, and if not set to low priority, will noticeably decrease system responsiveness..

in main.cpp, there are multiple points in which the priority is changed to "lowest":

Code:
   while (fGenerateBitcoins)
    {
        SetThreadPriority(THREAD_PRIORITY_LOWEST);

in util.h THREAD_PRIORITY_LOWEST is set to PRIO_MIN:

Code:
#define THREAD_PRIORITY_LOWEST          PRIO_MIN

however, PRIO_MIN == the "minimum" in raw numeric terms (as in -20 < 20), but this actually means the highest priority in terms of how the OS interprets the number for the purpose of CPU scheduling

in the kernel sources resource.h:

Code:
#define PRIO_MIN        (-20)
#define PRIO_MAX        20

Quote
"A niceness of −20 is the highest priority and 19 or 20 is the lowest priority."
- http://en.wikipedia.org/wiki/Nice_(Unix)

I believe that THREAD_PRIORITY_LOWEST should be set to PRIO_MAX, otherwise the bitcoind starts disrupting system usabilty during coin generation..


Thanks
asdfman

Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!