易截截图软件、单文件、免安装、纯绿色、仅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和windows文件名长度限制

Linux文件名的长度限制是255个字符
windows下完全限定文件名必须少于260个字符,目录名必须小于248个字符。
linux下文件数、目录数、文件名长度的各种限制
以下测试都是在没有优化或修改内核的前提下测试的结果
1. 测试目的:ext3文件系统下filename最大字符长度
  测试平台:RHEL5U3_x64
  测试过程:
L ......

linux下pwd命令


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

Linux 电驴(aMule)的安装与使用

在Linux中使用电驴是一件非常容易的事情,下面以Fedora6为例介绍安装使用步骤.
安装
--在安装之前请先确认,自己的系统中是否安装了wxGTK
这个包:
--使用系统自带的源即可安装
       # yum install wxGTK
--下载aMule并安装(此处安装的是Fedorazod版本)
     & ......

如何保障Linux用户安全

Linux应用范围的日益扩展,使得其使用性越来越受到关注。性是一个复杂和广泛的问题,此处我们主要关注Linux用户的账户安全,特别是Linux系统管理员如何保障用户的安全。
  
  
  口令安全
  
  
  Linux系统中的/etc/passwd文件含有全部系统需要知道的每个用户的信息(加密口令的密文也可能存于/etc/ ......

构建基本的嵌入式Linux根文件系统

构建基本的嵌入式Linux根文件系统
其实在去年8月份我做系统移植时就构建好了一个可以用的根文件系统,但是那时是跟着别人的《Linux全线移植文档》做的。有些东西我也不清楚,只是跟着做,做出来能用就了事了,没有深究其中的规范,以及文件系统中哪些要,哪些不要。
趁着今年过年的几天假期,我移植重新移植了U-Boot1.3.1 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号