📄 pthread_create.3
字号:
.\" This -*- nroff -*- file has been generated from.\" DocBook SGML with docbook-to-man on Debian GNU/Linux....\"...\" transcript compatibility for postscript use....\"...\" synopsis: .P! <file.ps>...\".de P!\\&..fl \" force out current output buffer\\!%PB\\!/showpage{}def...\" the following is from Ken Flowers -- it prevents dictionary overflows\\!/tempdict 200 dict def tempdict begin.fl \" prolog.sy cat \\$1\" bring in postscript file...\" the following line matches the tempdict above\\!end % tempdict %\\!PE\\!..sp \\$2u \" move below the image...de pF.ie \\*(f1 .ds f1 \\n(.f.el .ie \\*(f2 .ds f2 \\n(.f.el .ie \\*(f3 .ds f3 \\n(.f.el .ie \\*(f4 .ds f4 \\n(.f.el .tm ? font overflow.ft \\$1...de fP.ie !\\*(f4 \{\. ft \\*(f4. ds f4\"' br \}.el .ie !\\*(f3 \{\. ft \\*(f3. ds f3\"' br \}.el .ie !\\*(f2 \{\. ft \\*(f2. ds f2\"' br \}.el .ie !\\*(f1 \{\. ft \\*(f1. ds f1\"' br \}.el .tm ? font underflow...ds f1\".ds f2\".ds f3\".ds f4\"'\" t .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "pthread_create" "3" .SH "NAME" pthread_create \(em create a thread .SH "SYNOPSIS" .PP .nf .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n #include <rtl_sched.h> int \fBpthread_create\fP(pthread_t \fB*thread\fR, pthread_attr_t \fB*attr\fR, void *\fB(*start_routine)(void *)\fR, void \fB*arg\fR); .fi .SH "DESCRIPTION" .PP This function is an RTLinux version of standard POSIX threads function. \fBpthread_create\fP creates a realtime thread that will have attributes given by \fBattr\fR, and that begins executing function \fBstart_routine\fP(\fBarg \fR). If the attribute is NULL, default attributes are used. The thread attributes in RTLinux are extended to allow thread creation on specific processors (\fBpthread_attr_setcpu_np\fP), to enable FPU operations in the created thread (\fBpthread_attr_setfp_np\fP). .PP The standard thread attribute setting functions supported include \fBpthread_attr_setschedparam\fP, \fBpthread_attr_setdetachstate\fP, \fBpthread_attr_setstacksize\fP, \fBpthread_attr_setstackaddr\fP. The last call is to allow users to allocate memory for thread stacks -- so that threads can be created in RT operating mode by making use of pre-allocated memory. \fBpthread_join\fP should be used to synchronize freeing of thread resources including memory. For example if a thread is created with user allocated stack via \fBpthread_attr_setstackaddr\fP, that memory can only be safely reallocated after a \fBpthread_join\fP. .SH "RETURN VALUE" .PP \fBpthread_create\fP returns 0 on success and a non-zero error code on error. .SH "ERRORS" .IP "[EAGAIN]" 10 Either not enough memory, or PTHREAD_THREADS_MAX would be exceeded, or pthread_create is called from RT-thread context and preallocated stack use is not specified. .IP " [EINVAL]" 10 Bad attributes. .SH "AUTHOR" .PP Victor Yodaiken (\fIsupport@fsmlabs.com (link to URL mailto:support@fsmlabs.com) \fR) .SH "NOTES" .PP In the absense of preallocated stack (via \fBpthread_attr_setstackaddr\fP), the use of this function is restricted to the Linux \fBinit_module()\fP or \fBcleanup_module()\fP context. .SH "SEE ALSO" \fIUNIX spec pthread_create(3) (link to URL ../susv2/xsh/pthread_create.html) \fR, \fIpthread_attr_setstackaddr(3) (link to URL ../susv2/xsh/pthread_attr_getstackaddr.html) \fR, \fIpthread_attr_setstacksize(3) (link to URL ../susv2/xsh/pthread_attr_getstacksize.html) \fR, \fIpthread_join(3) (link to URL pthread_join.3.html) \fR, \fIpthread_make_periodic_np(3) (link to URL pthread_make_periodic_np.3.html) \fR, \fIpthread_attr_setcpu_np(3) (link to URL pthread_attr_setcpu_np.3.html) \fR, \fIpthread_attr_getcpu_np(3) (link to URL pthread_attr_getcpu_np.3.html) \fR, \fIpthread_attr_setfp_np(3) (link to URL pthread_attr_setfp_np.3.html) \fR .PP \(co2001 FSMLabs Inc. .PP All rights reserved. ...\" created by instant / docbook-to-man, Thu 26 Jul 2001, 11:19
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -