Add to git.
[pthrlib.git] / doc / new_pseudothread.3.html
1 <html>
2 <head>
3 <meta name="generator" content="groff -Thtml, see www.gnu.org">
4 <meta name="Content-Style" content="text/css">
5 <title>new_pseudothread</title>
6 </head>
7 <body>
8
9 <h1 align=center>new_pseudothread</h1>
10 <a href="#NAME">NAME</a><br>
11 <a href="#SYNOPSIS">SYNOPSIS</a><br>
12 <a href="#DESCRIPTION">DESCRIPTION</a><br>
13 <a href="#AUTHOR">AUTHOR</a><br>
14 <a href="#LICENSE">LICENSE</a><br>
15 <a href="#VERSION">VERSION</a><br>
16
17 <hr>
18 <!-- Creator     : groff version 1.17.2 -->
19 <!-- CreationDate: Fri Aug 30 16:16:30 2002 -->
20 <a name="NAME"></a>
21 <h2>NAME</h2>
22 <table width="100%" border=0 rules="none" frame="void"
23        cols="2" cellspacing="0" cellpadding="0">
24 <tr valign="top" align="left">
25 <td width="10%"></td><td width="90%">
26 new_pseudothread, pth_start, pseudothread_get_threads, pseudothread_count_threads - lightweight &quot;pseudothreads&quot; library</td></table>
27 <a name="SYNOPSIS"></a>
28 <h2>SYNOPSIS</h2>
29
30 <table width="100%" border=0 rules="none" frame="void"
31        cols="2" cellspacing="0" cellpadding="0">
32 <tr valign="top" align="left">
33 <td width="10%"></td><td width="90%">
34 <pre><b>#include &lt;pthr_pseudothread.h&gt;
35
36 pseudothread new_pseudothread (pool, void (*run) (void *), void *data, const char *name);
37 void pth_start (pseudothread pth);
38 vector pseudothread_get_threads (pool);
39 int pseudothread_count_threads (void);
40 </b></pre></td></table>
41 <a name="DESCRIPTION"></a>
42 <h2>DESCRIPTION</h2>
43
44 <table width="100%" border=0 rules="none" frame="void"
45        cols="2" cellspacing="0" cellpadding="0">
46 <tr valign="top" align="left">
47 <td width="10%"></td><td width="90%">
48 Pseudothreads are lightweight, cooperatively scheduled
49 threads.</td></table>
50
51 <table width="100%" border=0 rules="none" frame="void"
52        cols="2" cellspacing="0" cellpadding="0">
53 <tr valign="top" align="left">
54 <td width="10%"></td><td width="90%">
55 <b>new_pseudothread</b> creates a new pseudothread. The
56 thread only starts running when you call <b>pth_start</b>.
57 The <b>pool</b> argument passed is used for all allocations
58 within the thread. This pool is automatically deleted when
59 the thread exits. The <b>name</b> argument is the name of
60 the thread (used in thread listings -- see
61 <b>pseudothread_get_threads(3)</b>). You may change the name
62 later. The <b>run</b> and <b>data</b> arguments are the
63 entry point into the thread. The entry point is called as
64 <b>run (data)</b>.</td></table>
65
66 <table width="100%" border=0 rules="none" frame="void"
67        cols="2" cellspacing="0" cellpadding="0">
68 <tr valign="top" align="left">
69 <td width="10%"></td><td width="90%">
70 <b>pseudothread_get_threads</b> returns a list of all the
71 currently running pseudothreads. This allows you to
72 implement a &quot;process listing&quot; for a program. The
73 returned value is a vector of pseudothread structures (not
74 pointers). These structures are opaque to you, but you can
75 call the pth_get_* functions on the address of each
76 one.</td></table>
77
78 <table width="100%" border=0 rules="none" frame="void"
79        cols="2" cellspacing="0" cellpadding="0">
80 <tr valign="top" align="left">
81 <td width="10%"></td><td width="90%">
82 <b>pseudothread_count_threads</b> counts the number of
83 currently running threads.</td></table>
84 <a name="AUTHOR"></a>
85 <h2>AUTHOR</h2>
86
87 <table width="100%" border=0 rules="none" frame="void"
88        cols="2" cellspacing="0" cellpadding="0">
89 <tr valign="top" align="left">
90 <td width="10%"></td><td width="90%">
91 Richard Jones &lt;rich@annexia.org&gt;</td></table>
92 <a name="LICENSE"></a>
93 <h2>LICENSE</h2>
94
95 <table width="100%" border=0 rules="none" frame="void"
96        cols="2" cellspacing="0" cellpadding="0">
97 <tr valign="top" align="left">
98 <td width="10%"></td><td width="90%">
99 GNU LGPL (see http://www.gnu.org/)</td></table>
100 <a name="VERSION"></a>
101 <h2>VERSION</h2>
102
103 <table width="100%" border=0 rules="none" frame="void"
104        cols="2" cellspacing="0" cellpadding="0">
105 <tr valign="top" align="left">
106 <td width="10%"></td><td width="90%">
107 pthrlib-3.0.3</td></table>
108 <hr>
109 </body>
110 </html>