
Programming Release Notes
5.35 POSIX Threads Library
With process-shared objects, the objects such as mutexes and condition variables
can be shared among multiple processes. If a process terminates while owning a
mutex, the mutex will stay as owned by the terminated process. Hence none of
the other threads or processes can own that mutex.
However, there is an optional system service
sys$pshared_register
. Usage of
this system service makes the terminating process mark the mutexes that are
owned by it as abandoned.
In such a scenario, the call to pthread_mutex_lock would return EABANDONED
and the application could call pthread_mutex_tryforcedlock_np to get the
ownership of the abandoned mutex.
Return Values
If an error condition occurs, this routine returns an integer value indicating the
type of error. The possible return values can be:
Return Value Description
0 Successful completion
[EPERM] The mutex is no longer abandoned, and is now owned by some other
thread
[EINVAL] The mutex is not a process-shared mutex
[ENOSYS] Illegal system service called
5.35.4 Stack Overflows During Exception Handling (Integrity servers Only)
V8.2
Exception handling on Integrity servers requires considerably more stack space
than it does on Alpha. When porting an application from OpenVMS Alpha, if a
thread that uses exception handling does not have a generous amount of unused
stack space, the thread might experience a stack overflow during exception
handling on Integrity servers. Usually this appears as an improperly handled
ACCVIO that is associated with one of the following operations:
• RAISE
• pthread_cancel
• pthread_exit
• A thread has an active TRY or pthread_cleanup_push block, and an
OpenVMS condition is signaled (for example, as a hardware exception or
using LIB$SIGNAL or LIB$STOP).
If you see such a problem, try increasing the size of the stack allocated for the
thread by a small number of pages. HP recommends initially increasing the stack
by 24 KB.
The default stack size has been increased by 24KB to try to address the increased
stack usage on Integrity servers. If your application creates a large number
of threads (using the default size), the application might run out of memory
resources. If this happens, you might have to increase process quotas or make
application changes to reduce the number of threads that exist simultaneously.
Programming Release Notes 5–35