Other Threads-Related Information

1.All of the 3D graphics functions are cancellation points.

2.None of the 3D graphics functions are async-cancel safe.

3.None of the 3D graphics functions are async-signal safe.

4.None of the 3D graphics functions are fork-safe, i.e., they cannot be called by a child process after a fork(2), but before an exec(2).

___________________________________________________________________________

Note: Calls to 3D graphics functions between a fork and an exec have never been supported.

___________________________________________________________________________

5.There is one situation in which graphics behavior may be different for multi-threaded versus single-threaded programs. In a multi-threaded Starbase application, a call to gopen(3g) a serial plotter might not return if the plotter does not respond (e.g., if the plotter is turned off). In this multi-threaded case, the graphics thread could wait forever for the device. Single- threaded behavior in this case is for the gopen(3g) to timeout and return an error.

SIGALRM Details

The Starbase library temporarily sets a SIGALRM signal handler and uses setitimer(2) to start a timer in two situations:

1.To set a timeout for device access in calls to gopen(3g) for a serial plotter.

2.To set a maximum time to wait for an event in calls to await_event(3g),

read_choice_event(3g), read_locator_event(3g), and intread_locator_event(3g).

Calls to the above Starbase functions should not be made in one thread while at the same time another thread performs any of the following:

Changes the SIGALRM signal action;

Calls sigwait(2), selecting the SIGALRM signal;

Uses setitimer(2);

Uses timer_settime(2) to set a timer which will generate a SIGALRM signal.

Possible consequences of violating these non-concurrency restrictions are:

The Starbase function call never returns;

The wait for a plotter response or for an event is shorter than it should be;

Alarm signals from timers set in other threads do not have the desired effect (because the graphics signal handler is in place);

Unpredictable results due to concurrent use of the process-wide timer provided by setitimer(2).

Page 116

Graphics Administration Guide for HP-UX 10.20