![]() |
YAP 7.1.0
|
Normal multi-threaded applications should not need these the predicates from this section because almost any usage of these predicates is unsafe. More...
Normal multi-threaded applications should not need these the predicates from this section because almost any usage of these predicates is unsafe.
For example checking the existence of a thread before signalling it is of no use as it may vanish between the two calls Catching exceptions using catch/3 is the only safe way to deal with thread-existence errors
These predicates are provided for diagnosis and monitoring tasks
class current_thread/2 |
current_thread(+ Id, - Status)
Enumerates identifiers and status of all currently known threads Calling current_thread/2 does not influence any thread See also thread_join/2 For threads that have an alias-name, this name is returned in Id instead of the numerical thread identifier Status is one of:
class thread_property/2 |
thread_property(? Id, ? Property)
Enumerates the properties of the specified thread Calling thread_property/2 does not influence any thread See also thread_join/2 For threads that have an alias-name, this name can be used in Id instead of the numerical thread identifier Property is one of:
class thread_statistics/3 |
thread_statistics(+ Id, + Key, - Value)
Obtains statistical information on thread Id as statistics/2
does in single-threaded applications This call returns all keys of statistics/2
, although only information statistics about the stacks and CPU time yield different values for each thread
Print usage statistics on internal mutexes and mutexes associated with dynamic predicates For each mutex two numbers are printed: the number of times the mutex was acquired and the number of collisions: the number times the calling thread has to wait for the mutex The collision-count is not available on Windows as this would break portability to Windows-95/98/ME or significantly harm performance Generally collision count is close to zero on single-CPU hardware
Prints a table of current threads and their status