Specifications

Red Hat Enterprise Linux to Oracle Solaris Porting Guide
53
TABLE 5-1. IMPLEMENTATION-LEVEL DIFFERENCES
FUNCTION RHEL ORACLE SOLARIS 11
int pthread_cancel(pthread_t
thread);
On Linux, cancellation is
implemented using signals. Under
the NPTL threading
implementation, the first real-time
signal (that is, signal 32) is used for
this purpose. On LinuxThreads, the
second real-time signal is used if
real-time signals are available;
otherwise, SIGUSR2 is used.
A thread acting on a cancellation request runs
with all signals blocked. All thread termination
functions, including cancellation cleanup
handlers and thread-specific data destructor
functions, are called with all signals blocked. The
cancellation processing in target_thread
runs asynchronously with respect to the calling
thread returning from pthread_cancel().
void pthread_cleanup_push(void
(*routine)(void *), void *arg);
void pthread_cleanup_pop(int
execute)
On Linux, cancellation is
implemented using signals. Under
the NPTL threading
implementation, the first real-time
signal (tha this, signal 32) is used
for this purpose. On LinuxThreads,
the second real-time signal is used
if real-time signals are available;
otherwise, SIGUSR2 is used.
An exiting or cancelled thread runs with all
signals blocked. All thread termination functions,
including cancellation cleanup handlers, are
called with all signals blocked.
pthread_create int
pthread_create(pthread_t
*thread, const
pthread_attr_t *attr, void
*(*start_routine) (void
*), void *arg);
int pthread_create(pthread_t
*restrict thread, const
pthread_attr_t *restrict attr, void
*(*start_routine)(void*), void
*restrict arg);
int sig);
#include <signal.h>
#include <signal.h>
#include <pthread.h>
TABLE 5-2. DEFAULT THREAD ATTRIBUTES
ATTRIBUTE RHEL ORACLE SOLARIS 11 COMMENT
Contention scope
PTHREAD_SCOPE_SYSTEM
PTHREAD_SCOPE_PROCESS
Resource competition within process
Detach state
PTHREAD_CREATE_JOINABLE
PTHREAD_CREATE_JOINABLE
Joinable by other threads
Scheduling priority
0 0
Guard size 4096 bytes
PAGESIZE
Size of guard area for thread's stack
Stack size 0x201000 bytes 1 or 2 megabytes
Policy
SCHED_OTHER
SCHED_OTHER
Traditional time-sharing policy thread
Inherit scheduler PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED Scheduling policy and parameters are
inherited from the creating thread