Operating System - HP-UX
1833792 Members
2322 Online
110063 Solutions
New Discussion

Re: signal failures in threaded 11.00 env.

 
Chris Plezia
Occasional Contributor

signal failures in threaded 11.00 env.

We have a j5600 workstation running an application that consists some 25 IPC coordinated processes. Operating under 10.20, single threaded, all external socket connections maintain and all is good! We use "setitimer" to generate a 1 Hz SIGALRM event that in turns drives periodic socket message traffic to a NT Sim box. The bulk of the code is ADA but the socket, timer, and signal stuff is wrapped in a .a lib generated in C. We compile with aCC and link via c89 due to the legacy use of Rational's APEX ADA integrated development environment.

When we migrated to 11.00, some of the modules went multi-threaded. The "setitimer" signal events are no longer occurring! The itimerspec struct values are decrementing to zero, but no signal appears to be generated and we don't ever enter the signal handler which "sets" the flag to initiate another cycle of socket IO. We have developed small test programs in C to validate the signal constructs in our 11.00 env. They work fine! We know not to use "sleep, usleep and alarm" functions since they interfer with timer/signal operations.

Any thoughts on cause and/or other probable interactions would be greatly appreciated!

thanks,

Steve Barrett

SEA CORP
401-847-2260 x-3123
barrett@seacorp.com
1 REPLY 1
Mike Stroyan
Honored Contributor

Re: signal failures in threaded 11.00 env.

Signals are very different in a threaded environment. An asynchronous signal like SIGALRM may be delivered to any one of the threads in a process. If the ADA runtime support code is trying to manage asynchronous signals it may be using pthread_sigmask to block those signals in all but one thread and then using sigwait() to wait for those signals in a particular thread. That would soak up any SIGALRM that your code caused with setitimer.
Perhaps you could use a thread in your code to sleep for one second intervals and then initiate your socket I/O before looping back.
You can find many documents on programming with threads on HP-UX at
http://devresource.hp.com./devresource/Topics/Threads/Threads.html