Specifications

Red Hat Enterprise Linux to Oracle Solaris Porting Guide
52
take into account some minor differences in the interface, which are largely due to edge cases left
unspecified by the standard or by permitted implementation dependences.
Traditionally, both the platforms supported both POSIX and non-POSIX threads, but for new
application development and porting efforts on the latest versions of both operating systems, the
POSIX (Pthreads) model is recommended. Hence, this discussion is hereafter limited to
POSIX-compliant implementations only.
Oracle Solaris has a rich range of process scheduling features, and some of this is reflected in the
threading model. (For example, Oracle Solaris pthreads has a priority attribute that RHEL
pthreads lacks.) While most applications can do very well with the default scheduling, a large
number of threads and mission-critical enterprise-class multiprocess applications can benefit from
careful use of the various process scheduler features. For an introduction to the process scheduler, see
http://download.oracle.com/docs/cd/E19963-01/html/821-1460/rmfss-2.html
.As far as the
schedular is concerned, it is worth noting that RHEL NPTL has one area of noncompliance: NPTL
threads do not share a common nice value. Per POSIX standard, since all the threads are part of same
process, they should have a common nice value.
TABLE 5-1. IMPLEMENTATION-LEVEL DIFFERENCES
FUNCTION RHEL ORACLE SOLARIS 11
int
pthread_attr_init(pthread_attr_t
*attr);
int
pthread_attr_destroy(pthread_attr_
t *attr);
On Linux, these functions are
always assumed to succeed.
The pthread_attr_init() function will fail
with ENOMEM, if insufficient memory exists to
initialize the thread attributes object.
The pthread_attr_destroy() function
might fail with EINVAL if attr is invalid.
int pthread_atfork(void
(*prepare)(void), void
(*parent)(void), void
(*child)(void));
#include <pthread.h>
#include <sys/types.h>
#include <unistd.h>
The parent and child fork handlers
shall be called in the order in which
they were established by calls to
pthread_atfork(). The prepare
fork handlers shall be called in the
opposite order.
The prepare fork handler is called in LIFO (last-
in first-out) order, whereas the parent and child
fork handlers are called in FIFO (first-in first-out)
order. This calling order allows applications to
preserve locking order.