Compatibility Kit for POSIX Users
by Express Logic
Release 1, June 1, 2002
Compatibility Kit Overview
The POSIX Compatibility Kit is designed for current
POSIX customers. The kit defines the basic POSIX pthread services,
with some limitations, and utilizes ThreadX® primitives underneath.
The new POSIX compatibility layer should have very high performance,
since the Compatibility Kit utilizes internal ThreadX primitives
and bypasses basic ThreadX error checking. However, the application
will achieve even greater performance and size benefits if a complete
conversion to ThreadX is performed.
Compatibility Kit Source
The Compatibility Kit source code is designed
for simplicity and is comprised of only two files, namely tx_posix.h
and tx_posix.c. The tx_posix.h file defines all the necessary POSIX
constants and Subroutine prototypes, while tx_posix.c contains the
actual POSIX compatibility source. These Compatibility Kit source
files are common to all ThreadX support packages.
Compatibility Kit Documentation
The Compatibility Kit User Guide provides an overview
of the porting process, including various caveats and pitfalls to
watch out for. In addition, each covered POSIX Subroutine is documented,
including information about supported/unsupported options, limitations,
deviations, and suggestions on how to workaround any limitations.
Compatibility Kit Services
The current release of the Compatibility Kit supports
the following calls:
pthread related Subroutines:
sched_yield, pthread_create, pthread_detach,
pthread_join,
pthread_equal, pthread_exit, pthread_self, pthread_attr_destroy,
pthread_attr_getdetachstatem, pthread_attr_setdetachstate,
pthread_attr_getinheritsched, pthread_attr_setinheritsched,
pthread_attr_getschedparam, pthread_attr_setschedparam,
pthread_attr_getschedpolicy, pthread_attr_setschedpolicy,
pthread_attr_init, phread_attr_getstackaddr,
phread_attr_setstackaddr, pthread_attr_getstacksize,
pthread_attr_setstacksize, pthread_attr_getstack, pthread_attr_setstack,
pthread_setcancelstate, pthread_setcanceltype, pthread_cancel, pthread_yield
Semaphore related Subroutines:
sem_close, sem_getvalue, sem_open, sem_post,
sem_trywait, sem_unlink, sem_wait
Conditional Variable related Subroutines:
pthread_cond_destroy, pthread_cond_init, pthread_cond_broadcast,
pthread_cond_signal, pthread_cond_timedwait, pthread_cond_wait
Message Queue related Subroutines:
mq_send, mq_receive, mq_unlink, mq_close, mq_open
Mutex related Subroutines:
pthread_mutexattr_gettype, pthread_mutexattr_settypetype,
pthread_mutexattr_destroy, pthread_mutexattr_init,
pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock,
pthread_mutex_unlock, pthread_mutex_trylock,
pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol, pthread_mutexattr_getpshared,
pthread_mutexattr_setpshared,
pthread_mutex_timedlock
Compatibility Kit Error Handing
There are two "error handling" functions
defined in tx_posix.c and used throughout the Compatibility Kit,
as follows:
posix_internal_error, posix_error_handler
In general this routine is called when a basic
usage error occurs. This may be used as a place to catch errors
that are not detected if the application source is not checking
the return status. The default processing for this routine is a
simple spin loop.
Demonstration System
The file posix_demo.c contains a demonstration
system that utilizes POSIX services. This Demo application will
demonstrate some of the basic OS objects of POSIX such as: pthreads,
Semaphores, and Message Queus. This demo application should be used
as an example of how to integrate the Compatibility Kit into your
application.
Future Compatibility Kit Phases
Please get
in touch with us for next phases of this Compatibility Kit.
Trademarks
ThreadX is a registered trademark of Express Logic,
Inc. POSIX Compatibility Kit is a trademark of Express Logic, Inc.
|