pthread_attr_setcreatesuspend_np(3) [netbsd man page]
PTHREAD_ATTR_SETCREATESUSPEND_NP(3) BSD Library Functions Manual PTHREAD_ATTR_SETCREATESUSPEND_NP(3)NAME
pthread_attr_setcreatesuspend_np -- set attribute to create a thread suspended
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
int
pthread_attr_setcreatesuspend_np(pthread_attr_t attr);
DESCRIPTION
The pthread_attr_setcreatesuspend_np() function sets the attr argument, so that if this attr is used in a pthread_create(3) call, then the
thread created will not run, but it will remain blocked in the suspended queue, until pthread_resume_np(3) is called on it.
RETURN VALUES
The pthread_attr_setcreatesuspend_np() function always returns 0.
COMPATIBILITY
The function is a non-standard extension.
ERRORS
No errors are defined.
SEE ALSO pthread_create(3), pthread_resume_np(3), pthread_suspend_np(3)BSD July 9, 2010 BSD
Check Out this Related Man Page
PTHREAD_SUSPEND_NP(3) BSD Library Functions Manual PTHREAD_SUSPEND_NP(3)NAME
pthread_suspend_np, pthread_resume_np -- suspend/resume the given thread
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
int
pthread_suspend_np(pthread_t thread);
int
pthread_resume_np(pthread_t thread);
DESCRIPTION
The pthread_suspend_np() function suspends the thread given as argument. If thread is the currently running thread as returned by
pthread_self(3), the function fails and returns EDEADLK. Otherwise, it removes the named thread from the running queue, and adds it to the
suspended queue. The thread will remain blocked until pthread_resume_np() is called on it. In other words, pthread_resume_np() resumes the
thread given as argument, if it was suspended.
RETURN VALUES
Both functions return 0 on success and an error number indicating the reason for the failure.
COMPATIBILITY
These functions are non-standard extensions.
ERRORS
The pthread_suspend_np() function may fail if:
[EDEADLK] The thread requested to suspend was the currently running thread.
[ESRCH] The supplied thread was invalid.
The pthread_resume_np() function may fail if:
[ESRCH] The supplied thread was invalid.
NOTES
Some pthread_suspend_np() implementations may allow suspending the current thread. This is dangerous, because the semantics of the function
would then require the scheduler to schedule another thread, causing a thread context switch. Since that context switch can happen in a sig-
nal handler by someone calling pthread_suspend_np() in a signal handler, this is currently not allowed.
In pthread_resume_np() the NetBSD implementation does not check if the thread argument is not already suspended. Some implementations might
return an error condition if pthread_resume_np() is called on a non-suspended thread.
SEE ALSO pthread_attr_setcreatesuspend_np(3), pthread_self(3)BSD July 9, 2010 BSD
Hello
My problem goes like this:
I have used Pthread_create, and I have tryed to create 2 proccess but nothing happens! It does not even matter what the function im trying to create do. It is if im trying to activate an empty function. This is my code.
Any help will be highly appreciated.... (1 Reply)
Hi.
I use C++ and I wishes to create a thread with the pthread_create function, my question is, how can I do this if I wish that the function will be a member of the class ??
I know from windows programming that I can declare a static function like this
static unsigned int __stdcall... (7 Replies)
I read somewhere that I should use -pthread instead of -lpthread as compiler/linker flag, or define _REENTRANT. Is this incorrect to use only -lpthread? (I use gcc) (5 Replies)
Hi,
I'm trying to do my homework assignment but I am having trouble using the pthread_create fucntion.
Here is my code________________
//Alicia Johnson
//sum_pid program
//creates n number of threads. These threads create a random number
//then adds the number to a global array. Then... (1 Reply)
Hi all,
Sorry for the title because I didn't find a proper name for it. My question is about POSIX functions, such as timer_create(), mq_open() and pthread_create().
void test_queue()
{
struct mq_attr attr;
attr.mq_maxmsg = 10;
attr.mq_msgsize = 64;
mq_unlink("/my_test_queue");... (6 Replies)