tor-browser

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

pr_setconcurrency.rst (1244B)


      1 PR_SetConcurrency
      2 =================
      3 
      4 Creates extra virtual processor threads. Generally used with MP systems.
      5 
      6 
      7 Syntax
      8 ------
      9 
     10 .. code::
     11 
     12   #include <prinit.h>
     13 
     14   void PR_SetConcurrency(PRUintn numCPUs);
     15 
     16 
     17 Parameter
     18 ~~~~~~~~~
     19 
     20 :ref:`PR_SetConcurrency` has one parameter:
     21 
     22 ``numCPUs``
     23   The number of extra virtual processor threads to be created.
     24 
     25 
     26 Description
     27 -----------
     28 
     29 Setting concurrency controls the number of virtual processors that NSPR
     30 uses to implement its ``M x N`` threading model. The ``M x N`` model is
     31 not available on all host systems. On those where it is not available,
     32 :ref:`PR_SetConcurrency` is ignored.
     33 
     34 Virtual processors are actually\ *global* threads, each of which is
     35 designed to support an arbitrary number of\ *local* threads. Since
     36 global threads are scheduled by the host operating system, this model is
     37 particularly applicable to multiprocessor architectures, where true
     38 parallelism is possible. However, it may also prove advantageous on
     39 uniprocessor systems to reduce the impact of having a locally scheduled
     40 thread calling incidental blocking functions. In such cases, all the
     41 threads being supported by the virtual processor will block, but those
     42 assigned to another virtual processor will be unaffected.