ping: increase ping work thread priority
This commit is contained in:
@@ -1762,6 +1762,8 @@ static void *_fast_ping_work(void *arg)
|
|||||||
int sleep_time = 0;
|
int sleep_time = 0;
|
||||||
unsigned long expect_time = 0;
|
unsigned long expect_time = 0;
|
||||||
|
|
||||||
|
setpriority(PRIO_PROCESS, 0, -5);
|
||||||
|
|
||||||
sleep_time = sleep;
|
sleep_time = sleep;
|
||||||
now = get_tick_count() - sleep;
|
now = get_tick_count() - sleep;
|
||||||
last = now;
|
last = now;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <ucontext.h>
|
#include <ucontext.h>
|
||||||
@@ -512,10 +513,21 @@ static int _smartdns_create_logdir(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int _set_rlimit(void)
|
||||||
|
{
|
||||||
|
struct rlimit value;
|
||||||
|
value.rlim_cur = 40;
|
||||||
|
value.rlim_max = 40;
|
||||||
|
setrlimit(RLIMIT_NICE, &value);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int _smartdns_init_pre(void)
|
static int _smartdns_init_pre(void)
|
||||||
{
|
{
|
||||||
_smartdns_create_logdir();
|
_smartdns_create_logdir();
|
||||||
|
|
||||||
|
_set_rlimit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user