Home Explore Blog CI



neovim

53th chunk of `runtime/doc/luvref.txt`
d46659c02cd6019c5c34ff713cb41e72c0dcf2f44ab8118b0000000100000fa4
 : `integer` (signals received)
                - `nvcsw` : `integer` (voluntary context switches)
                - `nivcsw` : `integer` (involuntary context switches)

uv.getrusage_thread()                                    *uv.getrusage_thread()*
                Gets the resource usage measures for the calling thread.

                Note: Not supported on all platforms. May return `ENOTSUP`.

                On macOS and Windows not all fields are set (the unsupported
                fields are filled with zeroes).

                Returns: `table` or `fail`
                - `utime` : `table` (user CPU time used)
                  - `sec` : `integer`
                  - `usec` : `integer`
                - `stime` : `table` (system CPU time used)
                  - `sec` : `integer`
                  - `usec` : `integer`
                - `maxrss` : `integer` (maximum resident set size)
                - `ixrss` : `integer` (integral shared memory size)
                - `idrss` : `integer` (integral unshared data size)
                - `isrss` : `integer` (integral unshared stack size)
                - `minflt` : `integer` (page reclaims (soft page faults))
                - `majflt` : `integer` (page faults (hard page faults))
                - `nswap` : `integer` (swaps)
                - `inblock` : `integer` (block input operations)
                - `oublock` : `integer` (block output operations)
                - `msgsnd` : `integer` (IPC messages sent)
                - `msgrcv` : `integer` (IPC messages received)
                - `nsignals` : `integer` (signals received)
                - `nvcsw` : `integer` (voluntary context switches)
                - `nivcsw` : `integer` (involuntary context switches)

uv.available_parallelism()                          *uv.available_parallelism()*

                Returns an estimate of the default amount of parallelism a
                program should use. Always returns a non-zero value.

                On Linux, inspects the calling thread’s CPU affinity mask to
                determine if it has been pinned to specific CPUs.

                On Windows, the available parallelism may be underreported on
                systems with more than 64 logical CPUs.

                On other platforms, reports the number of CPUs that the
                operating system considers to be online.

                Returns: `integer`

uv.cpu_info()                                                    *uv.cpu_info()*

                Returns information about the CPU(s) on the system as a table
                of tables for each CPU found.

                Returns: `table` or `fail`
                - `[1, 2, 3, ..., n]` : `table`
                  - `model` : `string`
                  - `speed` : `number`
                  - `times` : `table`
                    - `user` : `number`
                    - `nice` : `number`
                    - `sys` : `number`
                    - `idle` : `number`
                    - `irq` : `number`

uv.cpumask_size()                                           *uv.cpumask_size()*

                Returns the maximum size of the mask used for process/thread
                affinities, or `ENOTSUP` if affinities are not supported on
                the current platform.

                Returns: `integer` or `fail`

uv.getpid()                                                        *uv.getpid()*

                DEPRECATED: Please use |uv.os_getpid()| instead.

uv.getuid()                                                        *uv.getuid()*

                Returns the user ID of the process.

                Returns: `integer`

                Note: This is not a libuv function and is not supported on
                Windows.

uv.getgid()                                                        *uv.getgid()*

                Returns the group ID of the process.

                Returns: `integer`

                Note: This is not a libuv function

Title: Libuv: Resource Usage, Parallelism, CPU Info, and Process IDs
Summary
This section covers Libuv functions for getting resource usage of the calling thread (`uv.getrusage_thread`), estimating the default amount of parallelism (`uv.available_parallelism`), retrieving CPU information (`uv.cpu_info`), obtaining the CPU mask size for affinities (`uv.cpumask_size`), and getting process and user/group IDs (`uv.getpid`, `uv.getuid`, `uv.getgid`). It notes platform-specific limitations for some functions and deprecation warnings for others.