23.10.2014 Views

PubTeX output 1998.09.24:1021

PubTeX output 1998.09.24:1021

PubTeX output 1998.09.24:1021

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

attributes(5)<br />

Headers, Tables, and Macros<br />

times umask uname<br />

unlink utime wait<br />

waitpid<br />

write<br />

MT-Safe with Exceptions<br />

See the NOTES sections of these pages for a description of the exceptions.<br />

Safe with Exceptions<br />

See the NOTES sections of these pages for a description of the exceptions.<br />

Fork1-Safe<br />

A Fork1-Safe library releases the locks it had held whenever fork1(2) is<br />

called in a Solaris thread program, or fork(2) in a POSIX (see<br />

standards(5) )thread program. Calling fork(2) in a POSIX thread<br />

program has the same semantic as calling fork1(2) in a Solaris thread<br />

program. All system calls, libpthread , and libthread are Fork1-Safe<br />

. Otherwise, you should handle the locking clean-up yourself (see<br />

pthread_atfork(3T) ).<br />

Cancel-Safety<br />

If a multi-threaded application uses pthread_cancel(3T) to cancel (that<br />

is, kill) a thread, it is possible that the target thread is killed while holding a<br />

resource, such as a lock or allocated memory. If the thread has not installed<br />

the appropriate cancellation cleanup handlers to release the resources<br />

appropriately (see pthread_cancel(3T) ), the application is<br />

"cancel-unsafe", that is, it is not safe with respect to cancellation. This<br />

unsafety could result in deadlocks due to locks not released by a thread that<br />

gets cancelled, or resource leaks; for example, memory not being freed on<br />

thread cancellation. All applications that use pthread_cancel(3T) should<br />

ensure that they operate in a Cancel-Safe environment. Libraries that have<br />

cancellation points and which acquire resources such as locks or allocate<br />

memory dynamically, also contribute to the cancel-unsafety of applications<br />

that are linked with these libraries. This introduces another level of safety<br />

for libraries in a multi-threaded program: Cancel-Safety. There are two<br />

sub-categories of Cancel-Safety: Deferred-Cancel-Safety, and<br />

Asynchronous-Cancel-Safety. An application is considered to be<br />

Deferred-Cancel-Safe when it is Cancel-Safe for threads whose cancellation<br />

type is PTHREAD_CANCEL_DEFERRED . An application is considered to be<br />

Asynchronous-Cancel-Safe when it is Cancel-Safe for threads whose<br />

19 SunOS 5.7 Last modified 3 June 1997

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!