1753792 Members
6913 Online
108799 Solutions
New Discussion юеВ

thread create, join ---

 
kommineni_1
Occasional Contributor

thread create, join ---

Pls, tell me examples about

thread object creation,
thread creation,
thread join,
thread exit
5 REPLIES 5
spex
Honored Contributor

Re: thread create, join ---

inventsekar_1
Respected Contributor

Re: thread create, join ---

Starting a Thread:
------------------
To start a thread, create it using the pthread_create( ) routine. This routine creates the
thread, assigns specified or default attributes, and starts execution of the function you
specified as the thread├в s start routine. A unique identifier (handle) for that thread is
returned by the pthread_create( ) routine.
Terminating a Thread:
---------------------
A thread terminates for any of the following reasons:
g The thread returns from its start routine; this is the usual case.
g The thread calls the pthread_exit( ) routine. The pthread_exit( ) routine terminates
the calling thread and returns a status value, indicating the thread├в s exit status to any
other thread that may be waiting for its termination.
g The thread is canceled by a call to the pthread_cancel( ) routine. The
pthread_cancel( ) routine requests termination of a specified thread if the thread
allows cancellation. (See Section 3.5 for more information on cancelling threads and
controlling whether or not cancellation is permitted.)
g An unhandled exception occurs in the thread.


refer man pages for:
pthread_create(3T), wait(2), pthread_join, pthread_cancel( ), pthread_exit(3T), pthread_join(3T), pthread_setcancelstate(3T),
pthread_cleanup_pop(3T), pthread_cond_wait(3T).
Be Tomorrow, Today.
inventsekar_1
Respected Contributor

Re: thread create, join ---

Attached a Good HP-UX Threads Example program from that pdf only.
Be Tomorrow, Today.
kommineni_1
Occasional Contributor

Re: thread create, join ---

Your response is very valuable.
thanks
inventsekar_1
Respected Contributor

Re: thread create, join ---

but u forget to assign points.
Be Tomorrow, Today.