当前位置: 首页 > news >正文

258做网站靠谱么企业网站推广

258做网站靠谱么,企业网站推广,做一个网站需要多少钱 怎么做,wordpress锚文字set_user_nice set_user_nice函数功能:设置某一进程的NICE值,其NICE值的计算是根据进程的静态优先级(task_struct->static_prio),直接通过set_user_nice函数更改进程的静态优先级。 内核源码 void set_user_nice…

set_user_nice

set_user_nice函数功能:设置某一进程的NICE值,其NICE值的计算是根据进程的静态优先级(task_struct->static_prio),直接通过set_user_nice函数更改进程的静态优先级。

内核源码

void set_user_nice(struct task_struct *p, long nice)
{bool queued, running;int old_prio;struct rq_flags rf;struct rq *rq;if (task_nice(p) == nice || nice < MIN_NICE || nice > MAX_NICE)return;/** We have to be careful, if called from sys_setpriority(),* the task might be in the middle of scheduling on another CPU.*/rq = task_rq_lock(p, &rf);update_rq_clock(rq);/** The RT priorities are set via sched_setscheduler(), but we still* allow the 'normal' nice value to be set - but as expected* it wont have any effect on scheduling until the task is* SCHED_DEADLINE, SCHED_FIFO or SCHED_RR:*/if (task_has_dl_policy(p) || task_has_rt_policy(p)) {p->static_prio = NICE_TO_PRIO(nice);goto out_unlock;}queued = task_on_rq_queued(p);running = task_current(rq, p);if (queued)dequeue_task(rq, p, DEQUEUE_SAVE | DEQUEUE_NOCLOCK);if (running)put_prev_task(rq, p);p->static_prio = NICE_TO_PRIO(nice);set_load_weight(p, true);old_prio = p->prio;p->prio = effective_prio(p);if (queued)enqueue_task(rq, p, ENQUEUE_RESTORE | ENQUEUE_NOCLOCK);if (running)set_next_task(rq, p);/** If the task increased its priority or is running and* lowered its priority, then reschedule its CPU:*/p->sched_class->prio_changed(rq, p, old_prio);out_unlock:task_rq_unlock(rq, p, &rf);
}
EXPORT_SYMBOL(set_user_nice);

使用示例

#include <linux/module.h>
#include <linux/pid.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/kthread.h>static int MyThreadFunc(void* argc) {printk("Prompt:kernel thread PID : %d.\n", current->pid);printk("Prompt:kernel thread static_prio : %d.\n", current->static_prio);printk("Prompt:kernel thread nice : %d.\n", task_nice(current));return 0;
}static int __init SetUserNiceInit(void) {struct task_struct* new_task = NULL;new_task = kthread_create_on_node(MyThreadFunc, NULL, -1, "setusernice.c");printk("Prompt:new thread nice : %d.\n", task_nice(new_task));printk("Prompt:new thread static_prio : %d.\n", new_task->static_prio);printk("Prompt:new thread prio : %d.\n", new_task->prio);set_user_nice(new_task, 16);printk("Prompt:new thread nice : %d.\n", task_nice(new_task));printk("Prompt:new thread static_prio : %d.\n", new_task->static_prio);printk("Prompt:new thread prio : %d.\n", new_task->prio);return 0;
}static void __exit SetUserNiceExit(void) {printk("Prompt:exit kernel.\n");
}module_init(SetUserNiceInit);
module_exit(SetUserNiceExit);

运行结果

http://www.yidumall.com/news/28622.html

相关文章:

  • 自己电脑怎么做网站服务器吗申请自己的网站
  • 怎样免费建微网站建立网站平台需要多少钱
  • 今年的公需课在哪个网站做深圳关键词优化
  • dedecms微电影网站模板拓客软件排行榜
  • 怎样查看网站关键词网络销售怎么样
  • 电器网站建设目的百度网盘pc网页版入口
  • 郑州网站怎么推广小型项目外包网站
  • 做网站seo的公司哪家好百度广告大全
  • 网站是生成静态好还是动态好cba目前排名
  • 珠海东莞网站建设兰州压热搜
  • 云南网站优化哪家好百度关键词排名查询工具
  • 品牌网站源码网站怎么营销推广
  • 茂名网站建设网络营销渠道可分为哪些
  • 如何做120急救网站seo导航
  • 广州定制网站开发免费seo刷排名
  • 关于h5的网站模板网络营销专业就业方向
  • 做搜狗手机网站优化点手机百度正式版
  • markdown做网站编辑器aso关键词搜索优化
  • 商城网站如何设计百度外推代发排名
  • wordpress qq头像泉州seo代理计费
  • 免费网站自动跳转免费入驻的电商平台
  • 营销网站建设方案网址查询
  • 网站建设图片上传操作如何建网站赚钱
  • 深圳做营销网站建设企业网站设计要求
  • c 网站开发中间层怎么写网站怎么优化关键词排名
  • 张家港网站建设门店徐州seo企业
  • 行距网站青岛谷歌seo
  • 哪些网站可以做视频直播怎么快速优化关键词排名
  • 模板网站外链做不起来网站点击排名优化
  • 网站申请收录竞价推广套户渠道商