home *** CD-ROM | disk | FTP | other *** search
-
-
-
- pppptttthhhhrrrreeeeaaaadddd____sssseeeettttccccoooonnnnccccuuuurrrrrrrreeeennnnccccyyyy((((3333PPPP)))) pppptttthhhhrrrreeeeaaaadddd____sssseeeettttccccoooonnnnccccuuuurrrrrrrreeeennnnccccyyyy((((3333PPPP))))
-
-
-
- NNNNAAAAMMMMEEEE
- pthread_setconcurrency, pthread_getconcurrency - modify scheduling
- concurrency
-
- CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<pppptttthhhhrrrreeeeaaaadddd....hhhh>>>>
-
- iiiinnnntttt pppptttthhhhrrrreeeeaaaadddd____sssseeeettttccccoooonnnnccccuuuurrrrrrrreeeennnnccccyyyy((((iiiinnnntttt lllleeeevvvveeeellll))));;;;
-
- iiiinnnntttt pppptttthhhhrrrreeeeaaaadddd____ggggeeeettttccccoooonnnnccccuuuurrrrrrrreeeennnnccccyyyy((((vvvvooooiiiidddd))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- Threads which are created with the PPPPTTTTHHHHRRRREEEEAAAADDDD____SSSSCCCCOOOOPPPPEEEE____PPPPRRRROOOOCCCCEEEESSSSSSSS attribute (which
- is the default) [see _p_t_h_r_e_a_d__a_t_t_r__s_e_t_s_c_o_p_e()], are scheduled on a number
- of kernel execution vehicles. By default the number of execution
- vehicles used is adjusted by the library as the application runs and is
- called the concurrency level. This is different from the traditional
- notion of concurrency because it includes any threads blocked by the
- application in the kernel (for example to do IO). The library raises or
- lowers the level to maintain a balance between user context switches and
- CPU bandwidth.
-
- An application may choose to give the library a hint as to the best
- concurrency level by using the _p_t_h_r_e_a_d__s_e_t_c_o_n_c_u_r_r_e_n_c_y() interface. The
- _l_e_v_e_l value indicates the concurrency that the application desires. This
- value will be used to compute the ideal number of execution vehicles for
- scheduling PPPPTTTTHHHHRRRREEEEAAAADDDD____SSSSCCCCOOOOPPPPEEEE____PPPPRRRROOOOCCCCEEEESSSSSSSS threads. If _l_e_v_e_l is zero the library
- reverts to its default mode; adjusting the level itself.
-
- The _p_t_h_r_e_a_d__g_e_t_c_o_n_c_u_r_r_e_n_c_y() interface returns the current concurrency
- level requested by _p_t_h_r_e_a_d__s_e_t_c_o_n_c_u_r_r_e_n_c_y() or zero if the default
- concurrency mode is being used.
-
- Concurrency is a matter of performance not correctness; an application
- will function correctly using the default mode. However the result may
- be overly conservative in its use of execution vehicles (and therefore
- CPUs). In this case performance may be improved by setting the
- concurrency level explicitly.
-
- Conversely the library will not permit changes to the concurrency level
- to create starvation. Should the application set the concurrency level
- to _n and then cause _n threads to block in the kernel the library will
- activate additional execution vehicles as needed to enable other threads
- to run. In this case the concurrency level is temporarily raised and
- will eventually return to the requested level.
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- On success _p_t_h_r_e_a_d__s_e_t_c_o_n_c_u_r_r_e_n_c_y() returns zero; otherwise an error
- number is returned:
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- pppptttthhhhrrrreeeeaaaadddd____sssseeeettttccccoooonnnnccccuuuurrrrrrrreeeennnnccccyyyy((((3333PPPP)))) pppptttthhhhrrrreeeeaaaadddd____sssseeeettttccccoooonnnnccccuuuurrrrrrrreeeennnnccccyyyy((((3333PPPP))))
-
-
-
- [[[[EEEEIIIINNNNVVVVAAAALLLL]]]] The value of _l_e_v_e_l is negative.
-
- _p_t_h_r_e_a_d__g_e_t_c_o_n_c_u_r_r_e_n_c_y() returns the current concurrency level (default
- is zero).
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- pthread_attr_setscope(3P).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-