在对当前的运行的进程进行阻塞时经常会用到wait_event()这个函数,来看看linux内核中时如何实现wait_event()这个函数的。先介绍几个宏定义函数:1.#defineDEFINE_WAIT_FUNC(name,function)\wait_queue_tname={\.private=current,\.func=function,\.task_list=LIST_HEAD_INIT((n..
分类:
其他好文 时间:
2014-10-23 06:55:07
阅读次数:
222
唤醒等待队列中的等待进程的函数wake_up()函数的核心实现函数是__wake_up_common()函数。__wake_up_common(wait_queue_head_t*q,intmode,intnr_exclusive,intwake_flags,void*key)参数介绍:q:是等待队列头;mode:是进程的状态模式其取值为:TASK_INTERRUPTIBLE,TASK_UNITERRUP..
分类:
其他好文 时间:
2014-10-23 06:51:54
阅读次数:
579
一、网页手机wap2.0网页的head里加入下面这条元标签,在iPhone的浏览器中页面将以原始大小显示,并不允许缩放。 其中: width - viewport的宽度 height - viewport的高度 initial-scale - 初始的缩放比例 minimum-scale - 允许用户...
分类:
Web程序 时间:
2014-10-23 01:13:25
阅读次数:
204
好题mark
1. 图论方法(最大权闭合子图)
#include
#include
#define min(a,b) ((a)<(b)?(a):(b))
const int N=1110;
const int E=5000;
const int oo=1000000000;
int node,src,dest,ne;
int head[N],work[N],Q[N],dist[N]...
分类:
其他好文 时间:
2014-10-22 18:16:38
阅读次数:
179
[Description] Given a unsort linked list, delete all the duplication from them, no temporary space permission.[Thought] Set two points, from head to t...
分类:
其他好文 时间:
2014-10-22 17:17:58
阅读次数:
120
1. linux下获取占用CPU资源最多的10个进程,可以使用如下命令组合:? ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head ? 2. linux下获取占用内存资源最多的10个进程,可以使用如下命令组合:? ?ps au...
分类:
系统相关 时间:
2014-10-22 14:46:23
阅读次数:
200
自适应布局(四种写法,三种方案) 1、使用position:absolute. <!doctype html> <html> <head> <style> body{ width: 100%; padding: 0; margin: 0; } div{ height: 500px; } .div1{ width: 100px; background: re...
分类:
其他好文 时间:
2014-10-21 23:22:51
阅读次数:
492
经常会在一些国外网站的head中看到如下代码: 不理解Meta Property=og标签是什么意思,以及对SEO的影响,看一下下面的介绍。 Meta Property=og标签是什么呢? og是一种新的HTTP头部标记,即Open Graph Protocol: The Open G...
分类:
Web程序 时间:
2014-10-21 19:22:28
阅读次数:
359
HTML文档中的base标签是很少用到的冷门标签之一,作用是通过它来规定网页链接的通用属性,可设置的属性有 target 和 href。 base标签必须加在html文档的head内,比如: <base?target="_blank"/> 这里就规定的该页...
分类:
Web程序 时间:
2014-10-21 12:31:32
阅读次数:
246
<!DOCTYPE?HTML>
?<html>
?<head>
?<meta?http-equiv="Content-Type"?content="text/html;?charset=UTF-8">
?<title>Insert?title?here</title>
?<!--样式-->
?<style?type="text/css">
?body?{ma...
分类:
其他好文 时间:
2014-10-21 12:29:52
阅读次数:
222