Hi
I'm currently involved in multithreaded development tasks on
Solaris 2.6 and trying to make sense of the MT attributes for
system/library calls.
Especially, I'm wondering wether 'time' can be called safely
in a multithreaded app.
On the manpage of 'time' I read
____________________________________
| ATTRIBUTE TYPE| ATTRIBUTE VALUE |
|_______________|___________________|
| MT-Level | Async-Signal-Safe|
|_______________|___________________|
and for async-safety attributes(5) tells me
Async-Signal-Safe refers to particular library
routines that can be safely called from a signal
handler. A thread that is executing an Async-
Signal-Safe routine will not deadlock with
itself if interrupted by a signal. Signals are
only a problem for MT-Safe routines that acquire
locks.
Signals are disabled when locks are acquired in
Async-Signal-Safe routines. This prevents a
signal handler that might acquire the same lock
from being called.
Now, this description tells me that a thread calling
'time' won't deadlock in the call when interrupted
and that signals are disabled in 'time' whenever it
acquires locks.
It doesn't tell me wether any data can be corrupted
on reentering the call (i.e. is it 'Safe' ?) or wether
concurrency is provided (i.e. is it 'MT-Safe' ?).
Can anybody shed some light on this topic ?
Thanks a lot
Gunther