Availability:built-in
[semidet]thread_idle(:Goal,
+Duration)Indicates to the system that the calling thread will idle for some time
while calling Goal as once/1.
This call releases resources to the OS to minimise the footprint of the
calling thread while it waits. Despite the name this predicate is always
provided, also if the system is not configured with tcmalloc or is
single threaded.
Duration is one of
- short
- Calls trim_stacks/0
and, if tcmalloc is used, calls
MallocExtension_MarkThreadTemporarilyIdle() which empties the thread's
malloc cache but preserves the cache itself.
- long
- Calls garbage_collect/0
and trim_stacks/0
and, if tcmalloc is used, calls MallocExtension_MarkThreadIdle() which
releases all thread-specific allocation data structures.