tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

prthreadpriority.rst (1617B)


      1 PRThreadPriority
      2 ================
      3 
      4 A thread's priority setting.
      5 
      6 
      7 Syntax
      8 ------
      9 
     10 .. code::
     11 
     12   #include <prthread.h>
     13 
     14   typedef enum PRThreadPriority
     15   {
     16      PR_PRIORITY_FIRST   = 0,
     17      PR_PRIORITY_LOW     = 0,
     18      PR_PRIORITY_NORMAL  = 1,
     19      PR_PRIORITY_HIGH    = 2,
     20      PR_PRIORITY_URGENT  = 3,
     21      PR_PRIORITY_LAST    = 3
     22   } PRThreadPriority;
     23 
     24 
     25 Enumerators
     26 ~~~~~~~~~~~
     27 
     28 ``PR_PRIORITY_FIRST``
     29   Placeholder.
     30 ``PR_PRIORITY_LOW``
     31   The lowest possible priority. This priority is appropriate for
     32   threads that are expected to perform intensive computation.
     33 ``PR_PRIORITY_NORMAL``
     34   The most commonly expected priority.
     35 ``PR_PRIORITY_HIGH``
     36   Slightly higher priority than ``PR_PRIORITY_NORMAL``. This priority
     37   is for threads performing work of high urgency but short duration.
     38 ``PR_PRIORITY_URGENT``
     39   Highest priority. Only one thread at a time typically has this
     40   priority.
     41 ``PR_PRIORITY_LAST``
     42   Placeholder
     43 
     44 
     45 Description
     46 -----------
     47 
     48 In general, an NSPR thread of higher priority has a statistically better
     49 chance of running relative to threads of lower priority. However,
     50 because of the multiple strategies NSPR uses to implement threading on
     51 various host platforms, NSPR priorities are not precisely defined. At
     52 best they are intended to specify a preference in the amount of CPU time
     53 that a higher-priority thread might expect relative to a lower-priority
     54 thread. This preference is still subject to resource availability and
     55 must not be used in place of proper synchronization.
     56 
     57 
     58 See Also
     59 --------
     60 
     61 `Setting Thread
     62 Priorities <Introduction_to_NSPR#Setting_Thread_Priorities>`__.