libgpac
Documentation of the core library of GPAC
|
Threading and Mutual Exclusion. More...
Modules | |
Thread | |
Thread processing. | |
Mutex | |
Mutual exclusion. | |
Semaphore | |
Semaphore. | |
Data Structures | |
struct | GF_SystemRTInfo |
run-time system info object More... | |
Enumerations | |
enum | { GF_RTI_ALL_PROCESSES_TIMES = 1 , GF_RTI_PROCESS_MEMORY = 1<<1 , GF_RTI_SYSTEM_MEMORY_ONLY = 1<<2 } |
Functions | |
u32 | gf_sys_get_process_id () |
Gets process ID. More... | |
Bool | gf_sys_get_rti (u32 refresh_time_ms, GF_SystemRTInfo *rti, u32 flags) |
Gets Run-Time info. More... | |
Time manipulation tools.
This section documents the threading of the GPAC framework. These provide an easy way to implement safe multithreaded tools.
Available tools are thread, mutex and semaphore
struct GF_SystemRTInfo |
The Run-Time Info object is used to get CPU and memory occupation of the calling process. All time values are expressed in milliseconds (accuracy is not guaranteed).
Data Fields | ||
---|---|---|
u32 | sampling_instant |
start of the sampling period |
u32 | sampling_period_duration |
duration of the sampling period |
u32 | total_cpu_time |
total amount of time (User+kernel) spent in CPU for all processes as evaluated at the end of the sampling period |
u32 | process_cpu_time |
total amount of time (User+kernel) spent in CPU for the calling process as evaluated at the end of the sampling period |
u32 | total_cpu_time_diff |
amount of time (User+kernel) spent in CPU for all processes during the sampling period |
u32 | process_cpu_time_diff |
total amount of time (User+kernel) spent in CPU for the calling process during the sampling period |
u32 | cpu_idle_time |
total amount of idle time during the sampling period. |
u32 | total_cpu_usage |
percentage (from 0 to 100) of CPU usage during the sampling period. |
u32 | process_cpu_usage |
percentage (from 0 to 100) of the CPU usage by the calling process during the sampling period. |
u32 | pid |
calling process ID |
u32 | thread_count |
calling process thread count if known |
u64 | process_memory |
size of calling process allocated heaps |
u64 | physical_memory |
total physical memory in system |
u64 | physical_memory_avail |
available physical memory in system |
u64 | gpac_memory |
total memory currently allocated by gpac |
u32 | nb_cores |
total number of cores on the system |
anonymous enum |
Selection flags for run-time info retrieval
u32 gf_sys_get_process_id | ( | ) |
Gets ID of the process running this gpac instance.
Bool gf_sys_get_rti | ( | u32 | refresh_time_ms, |
GF_SystemRTInfo * | rti, | ||
u32 | flags | ||
) |
Gets CPU and memory usage info for the calling process and the system. Information gathering is controled through timeout values.
refresh_time_ms | refresh time period in milliseconds. If the last sampling was done less than this period ago, the run-time info is not refreshed. |
rti | holder to the run-time info structure to update. |
flags | specify which info is to be retrieved. |