易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux的工作队列

1,先看看工作队列和tasklet的区别:
    (1) 定时器和tasklet:
    Tasklets resemble kernel timers in 3 ways.
      1)They are always run at interrupt time,
      2)they always run on the same CPU that schedules them,
      3)and they receive an unsigned long argument.   Unlike kernel timers, however, you can’t ask to execute the function at a specific time.
     (2) tasklet和工作队列:
     Workqueues are, superficially, similar to tasklets; they allow kernel code to request that a function be called at some future time. There are, however, some significant differences between the two, including:
        1) Tasklets run in software interrupt context with the result that all tasklet code must be atomic. Instead, workqueue functions run in the context of a special kernel process; as a result, they have more flexibility. In particular, workqueue functions can sleep.
        2)Tasklets always run on the processor from which they were originally submitted. Workqueues work in the same way, by default.
        3)Kernel code can request that the execution of workqueue functions be delayed for an explicit interval.
2,工作队列(work queue)是Linux kernel中将工作推后执行的一种机制。这种机制和BH或Tasklets不同之处在于工作队列是把推后的工作交由一个内核线程去执行,因此工作队列的优势就在于它允许重新调度甚至睡眠。工作队列是2.6内核开始引入的机制,在2.6.20之后,工作队列的数据结构发生了一些变化,因此本文分成两个部分对2.6.20之前和之后的版本分别做介绍。
    (1)2.6.0~2.6.19
数据结构:
struct work_struct {
    unsigned long pending;
    struct list_head entry;
    void (*func)(void *);
    void *data


相关文档:

linux下pwd命令


在linux下,估计你经常使用pwd这个命令,这个命令就是打印当前的工作路径,即print working directroy, 今天我们也来c语言实现这个命令。
要实现这个功能,需要用到下面的一个系统调用:
#include <unistd.h>
 
char *getcwd(char *buf, size_t size);
该系统调用返回当前的工作目录的绝对路径,绝对路径 ......

linux 站点2

2。 技术网点:
csdn.net
chinaunix.net
ibm.com/developerworks/cn/linux
Linux内存使用详解:
http://blog.chinaunix.net/u2/67750/showart_2154542.html
3。 Linux技术点
系统管理命令(expect.)
shell编程
正则表达式
busybox
文件系统
4。 其它技术点
pclint(静态代码检查工具)
source monitor ......

Moto Linux应用开发(六):USB连接共享PC上网

由于在开发A1200上的流媒体播放器,免不了长期播放视频,进行稳定性测试。开始是通过GPRS拨号上网,但播放视频太费流量了,充个50元,都顶不住一天的测试。看到window mobile的手机都可以通过PC上网,因此想到moto linux手机也可以共享PC上网,节省流量费用。从理论上将是可行的,因为moto手机可以开启USB LAN,通过USB连接 ......

Ubuntu Linux系统环境变量配置文件介绍


Ubuntu Linux系统环境变量配置文件介绍
 
发布时间:2007.12.19 06:30     来源:赛迪网    作者:sixth
在Ubuntu中有如下几个文件可以设置环境变量
 
/etc/profile:在登录时,操作系统定制用户环境时使用的第一个文件,此文件为系统的每个用户设置环境信息,当用 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号