*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> pthread_setconcurrency (3p)              
Title
Content
Arch
Section
 

Contents


pthread_setconcurrency(3P)			    pthread_setconcurrency(3P)


NAME    [Toc]    [Back]

     pthread_setconcurrency, pthread_getconcurrency - modify scheduling
     concurrency

C SYNOPSIS    [Toc]    [Back]

     #include <pthread.h>

     int pthread_setconcurrency(int level);

     int pthread_getconcurrency(void);

DESCRIPTION    [Toc]    [Back]

     Threads which are created with the	PTHREAD_SCOPE_PROCESS attribute	(which
     is	the default) [see pthread_attr_setscope()], 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 pthread_setconcurrency() interface.	 The
     level value indicates the concurrency that	the application	desires.  This
     value will	be used	to compute the ideal number of execution vehicles for
     scheduling	PTHREAD_SCOPE_PROCESS threads.	If level is zero the library
     reverts to	its default mode; adjusting the	level itself.

     The pthread_getconcurrency() interface returns the	current	concurrency
     level requested by	pthread_setconcurrency() 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.

DIAGNOSTICS    [Toc]    [Back]

     On	success	pthread_setconcurrency() returns zero; otherwise an error
     number is returned:






									Page 1






pthread_setconcurrency(3P)			    pthread_setconcurrency(3P)



     [EINVAL]	    The	value of level is negative.

     pthread_getconcurrency() returns the current concurrency level (default
     is	zero).

SEE ALSO    [Toc]    [Back]

      
      
     pthread_attr_setscope(3P).


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
npri IRIX modify the scheduling priority of a process
idprio FreeBSD execute, examine or modify a utility's or process's realtime or idletime scheduling priority
rtprio FreeBSD execute, examine or modify a utility's or process's realtime or idletime scheduling priority
pthread_getconcurrency OpenBSD get or set level of concurrency
pthread_getconcurrency FreeBSD get or set level of concurrency
pthread_setconcurrency OpenBSD get or set level of concurrency
pthread_setconcurrency FreeBSD get or set level of concurrency
pthread_setconcurrency Tru64 Changes the value of the concurrency level global variable for this process
pthread_getschedparam Tru64 Obtains the current scheduling policy and scheduling parameters of a thread
sched_setscheduler Tru64 Sets the scheduling policy and scheduling parameters of the specified process (P1003.1b)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service