add function get_sys_cpu_count()
parent
f734884700
commit
0fe90e35da
5
HISTORY
5
HISTORY
|
|
@ -1,10 +1,11 @@
|
||||||
|
|
||||||
Version 1.23 2015-11-03
|
Version 1.23 2015-11-04
|
||||||
* sched_thread.c: task can execute in a new thread
|
* sched_thread.c: task can execute in a new thread
|
||||||
* sched_thread.c: support delay tasks
|
* sched_thread.c: support delay tasks
|
||||||
* add function get_current_time_us and get_current_time_ms
|
* add function get_current_time_us and get_current_time_ms
|
||||||
* mblock add stat function
|
* mblock add stat function
|
||||||
* add function get_sys_total_mem_size, ONLY support Linux and FreeBSD
|
* add function get_sys_total_mem_size and get_sys_cpu_count,
|
||||||
|
ONLY support Linux and FreeBSD
|
||||||
* delay task can execute in a new thread
|
* delay task can execute in a new thread
|
||||||
* fast_mblock reclaimed object pool
|
* fast_mblock reclaimed object pool
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2312,3 +2312,12 @@ int get_sys_total_mem_size(int64_t *mem_size)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int get_sys_cpu_count()
|
||||||
|
{
|
||||||
|
#if defined(OS_LINUX) || defined(OS_FREEBSD)
|
||||||
|
return sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
#else
|
||||||
|
#error port me!
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -535,6 +535,13 @@ int64_t get_current_time_us();
|
||||||
*/
|
*/
|
||||||
int get_sys_total_mem_size(int64_t *mem_size);
|
int get_sys_total_mem_size(int64_t *mem_size);
|
||||||
|
|
||||||
|
|
||||||
|
/** get system CPU count
|
||||||
|
* parameters:
|
||||||
|
* return: error no , 0 success, != 0 fail
|
||||||
|
*/
|
||||||
|
int get_sys_cpu_count();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue