YAP 7.1.0
Signalling Threads

These predicates provide a mechanism to make another thread execute some goal as an interrupt More...

Detailed Description

These predicates provide a mechanism to make another thread execute some goal as an interrupt

Signalling threads is safe as these interrupts are only checked at safe points in the virtual machine Nevertheless, signalling in multi-threaded environments should be handled with care as the receiving thread may hold a mutex (see with_mutex/2 ) Signalling probably only makes sense to start debugging threads and to cancel no-longer-needed threads with throw/1 , where the receiving thread should be designed carefully do handle exceptions at any point


Class Documentation

◆ thread_sleep/1

class thread_sleep/1

thread_sleep(+ Time)

th Make current thread sleep for Time seconds Time may be an integer or a floating point number When time is zero or a negative value the call succeeds and returns immediately This call should not be used if alarms are also being used