Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_multi_np(3) [freebsd man page]

PTHREAD_MULTI_NP(3)					   BSD Library Functions Manual 				       PTHREAD_MULTI_NP(3)

pthread_multi_np, pthread_single_np -- switch between multi- and single-threaded scheduling modes LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread_np.h> int pthread_multi_np(void); int pthread_single_np(void); DESCRIPTION
The pthread_single_np() function switches the process to a single-threaded mode, i.e., suspends all threads except the current. The seman- tics of this function is similar to pthread_suspend_all_np(3). The pthread_multi_np() function switches the process to a multi-threaded mode. The semantics of this function is similar to pthread_resume_all_np(3). RETURN VALUES
The pthread_multi_np() and pthread_single_np functions always return 0. SEE ALSO
pthread_resume_all_np(3), pthread_suspend_all_np(3) AUTHORS
This manual page was written by Alexey Zelkin <>. BSD
February 13, 2003 BSD

Check Out this Related Man Page

PTHREAD_ATTR_GET_NP(3)					   BSD Library Functions Manual 				    PTHREAD_ATTR_GET_NP(3)

pthread_attr_get_np -- get attributes of existent thread LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread_np.h> int pthread_attr_get_np(pthread_t pid, pthread_attr_t *dst); DESCRIPTION
The pthread_attr_get_np() function is used to get existent thread's attributes. Most fields of pthread_attr_t structure are exact values of attributes provided at thread creation time (as parameter to pthread_create(3) function), except for the stack address. Value returned as dst is supposed to be used in conjunction with pthread_attr_get*() functions to retrieve individual values from pthread_attr_t structure. Parameter dst should point to allocated memory area big enough to fit this structure. It is HIGHLY RECOMMENDED to use pthread_attr_init(3) function to allocate attribute storage. IMPLEMENTATION NOTES
The pthread_attr_get_np() function will always return a pointer to the thread's real stack address, regardless of its value in the original attributes structure. RETURN VALUES
If successful, pthread_attr_get_np() function returns 0. Otherwise, an error number is returned to indicate the error. EXAMPLES
size_t my_thread_stack_size(pthread_t pid) { pthread_attr_t attr; size_t size; pthread_attr_init(&attr); pthread_attr_get_np(pid, &attr); pthread_attr_getstacksize(&attr, &size); pthread_attr_destroy(&attr); return(size); } ERRORS
The pthread_attr_get_np() function will fail if: [EINVAL] Invalid value for one of given parameters. [ESRC] No thread could be found corresponding to that specified by the given thread ID. SEE ALSO
pthread_attr_destroy(3), pthread_attr_getdetachstate(3), pthread_attr_getinheritsched(3), pthread_attr_getschedparam(3), pthread_attr_getschedpolicy(3), pthread_attr_getscope(3), pthread_attr_getstack(3), pthread_attr_getstackaddr(3), pthread_attr_getstacksize(3), pthread_attr_init(3) AUTHORS
The pthread_attr_get_np() function and this manual page were written by Alexey Zelkin <>. BSD
January 31, 2003 BSD
Man Page

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script for multi-threaded bash processes

hey everyone, I'm having some trouble breaking down some code. It's simple a control script that takes machines meant to be backed up from a list. Then according to that will run multi-threaded processes up until the specified thread limit. for example if there are 4 machines to be backed up,... (2 Replies)
Discussion started by: terrell
2 Replies

2. UNIX for Advanced & Expert Users

Which process has created a file ?

Hi All, We have a multi-threaded application. During the course of action, each process creates some files. Is there any way to know which process has created a particular file ? Ex: Suppose we have 3 process running A, B and C in the application and some files FILE1 FILE2 FILE3 and... (4 Replies)
Discussion started by: 14341
4 Replies