HPlogo Communicator e3000 MPE/iX Express 1 Based on Release 7.0 > Chapter 6 Technical Articles

POSIX pthread (Draft 10) APIs

MPE documents

Complete PDF
Table of Contents
Index

by Ranjani Narayan
Commercial Systems Division

Introduction


Up until now, customers of the HP e3000 have been facing problems with the threads implementation on MPE/iX. Though DCE did provide "workarounds" to get around these problems, these workarounds were insufficient for multiple reasons. Firstly, the workarounds applied only for DCE applications. Customers with JAVA and other applications using POSIX implementation of threads did not have a solution. Also, these workarounds resulted in performance problems, especially for high-end customers implementing DCE. Hence a solution for these customers was to provide the necessary POSIX pthread (Draft 10) APIs as part of FOS on MPE/iX. This article gives a technical overview of the changes done to the various subsystems in order to provide a subset of POSIX pthread (Draft 10) APIs.

Current Limitations


Prior to this release, in order to write a multi-threaded application, it was mandatory to buy the DCE product on MPE/iX, since threads was packaged along with the DCE product. This had the following disadvantages:
  • Mandatory to buy the DCE product to use threads feature

  • Dependency on the DCE product for enhancements, fixes and maintenance

  • A logical part of the MPE/iX Operating System (threads) was made a part of a product (DCE)

Solution Objectives

The main objectives of this solution are to provide threads as a part of FOS (make threads a logical part of the MPE/iX Operating System), and to provide all the necessary POSIX thread interfaces as per customer (JAVA) requirements. The other objectives are to provide POSIX signals as per specification and to asynchronously cancel threads (when desired).

Overview of solution

Make available Draft 10 threads APIs as per customer needs: Prior to this release, the thread APIs that were provided as part of DCE were Draft 4 compliant. With this release, POSIX pthread APIs are provided as a part of FOS and are Draft 10 compliant (unless explicitly stated). However, it is to be noted that the entire POSIX Draft 10 threads APIs are not provided as a part of this solution. Only those APIs which are immediately needed by JAVA and DCE are provided.

Interaction of POSIX signals with thread APIs on MPE/iX: Prior to this release, there have been problem reports from customers regarding the functioning of signals in MPE/iX, specifically with respect to threads. With this release, signals behave the way they should, as stated in POSIX 1003.c standard.

Support cancellation points for threads to become cancel aware: Until now, customers could not asynchronously cancel threads on MPE/iX. With this release, threads can be asynchronously cancelled, if desired, according to the POSIX 1003.c standard.

The following POSIX threads APIs are provided as a part of this solution:
pthread_atfork, pthread_sigmask, pthread_kill, pthread_mutex_init, pthread_mutex_destroy, pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock, pthread_cond_init, pthread_cond_destroy, pthread_cond_signal, pthread_cond_broadcast, pthread_cond_wait, pthread_cond_timedwait, pthread_attr_setscope, pthread_getschedparam, pthread_setschedparam, pthread_attr_init, pthread_attr_destroy, pthread_attr_setstacksize, pthread_attr_getstacksize, pthread_create, pthread_join, pthread_detach, pthread_exit, pthread_self, pthread_once, pthread_key_create, pthread_setspecific, pthread_getspecific, pthread_cancel, pthread_setcancelstate, pthread_setcanceltype, pthread_testcancel, pthread_cleanup_push, pthread_cleanup_pop, pthread_continue, pthread_suspend, alarm, pause, sleep.

The following POSIX signals have been implemented as a part of this solution:
kill, sigemptyset, sigfillset, sigaddset, sigdelset, sigismember, sigaction, sigprocmask, sigpending, sigsuspend, sigwait, sigwaitinfo, sigtimedwait, sigqueue.

Highlights of solution

Some of the important enhancements provided for this solution are:
  • "forking" from a threaded environment

  • "exec" family of APIs work in multi-threaded environment

  • Signals implemented in threaded environment as per POSIX Draft 10 specification

Benefits to Customers


As more and more POSIX applications are ported to MPE/iX, the need for POSIX compliance on MPE/iX increases. In order to retain customers loyal to MPE/iX as well as attract new customers, and in order to reduce the time required for porting onto MPE/iX, it is desired that we provide all necessary APIs on MPE. This release provides missing/non-functioning APIs of threads and signals

JAVA is one of the (many) middle-level applications needed for other e-services applications. With HP e3000 moving towards e-solutions, it is necessary to e-enable MPE/iX. Providing threads as part of FOS on MPE/iX is one step towards that goal.

Conclusion


A subset of POSIX pthreads (Draft 10) APIs is packaged as a part of FOS on this release of MPE/iX. This enhancement enables applications wishing to use POSIX pthreads (Draft 10) APIs to be ported from other platforms with minimal porting effort. New multi-threaded applications can be written and executed on HP e3000 with minimal effort.




CI Enhancements


Chapter 7 Product Release History