OS thread
Represents a thread of an operating system process, providing details about its execution, resource usage, and associated metadata
Original source
The thread information are retrieved from OperatingSystem.OSThread interface
KInfo's source
Properties
threadId
The unique identifier for the thread
name
The name of the thread (e.g., "main", "worker")
state
The current state of the thread (e.g., running, sleeping)
threadCpuLoadCumulative
The cumulative CPU load of the thread as a percentage
val threadCpuLoadCumulative: Double = currentThread.threadCpuLoadCumulative
println(threadCpuLoadCumulative) // e.g. 3.8
threadCpuLoadBetweenTicks
The CPU load of the thread between two ticks, as a percentage
val threadCpuLoadBetweenTicks: Double = currentThread.threadCpuLoadBetweenTicks
println(threadCpuLoadBetweenTicks) // e.g. 1.2
owningProcessId
The process ID of the process that owns the thread
startMemoryAddress
The starting memory address of the thread
val startMemoryAddress: Long = currentThread.startMemoryAddress
println(startMemoryAddress) // e.g. 140737488355328
contextSwitches
The number of context switches performed for the thread
minorFaults
The number of minor page faults experienced by the thread
majorFaults
The number of major page faults experienced by the thread
kernelTime
The total amount of time the thread has spent in kernel mode, in milliseconds
userTime
The total amount of time the thread has spent in user mode, in milliseconds
upTime
The total uptime of the thread, in milliseconds
startTime
The start time of the thread, in milliseconds since the Unix epoch
priority
The priority level of the thread
updateAttributes
A flag indicating whether the thread attributes should be updated