- 博客(14)
- 资源 (4)
- 收藏
- 关注
原创 java 代理
import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; import java.lang.reflect.Method; //抽象角色:java动态代理的实现目前只支持接口,不支持抽象类 interface BusinessFoo {
2012-10-28 11:38:01 384
原创 java 反射
import java.lang.reflect.Field;import java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;public class DirectPropertyAccessor { /** * @param args * @throws Securi
2012-10-28 11:35:48 401
转载 sem 信号量
#include #include #include #include #define NBUFF 100int nitems;sem_t mutex;sem_t nempty;sem_t nstored;int buff[NBUFF];void *produce(void *arg){ int i; for (i = 0; i
2012-10-06 22:10:57 600
原创 pthread_sigmask
#include #include #include #define NUMTHREADS 3void sighand(int signo);void *threadfunc(void *parm){ pthread_t tid = pthread_self(); int rc; p
2012-10-06 21:20:29 909
原创 pthread_key_create
/* * int pthread_key_create(pthread_key_t *key, void (*destr_function) (void *)) * * 该函数从TSD池中分配一项,将其值赋给key供以后访问使用。如果destr_function不为空,在线程退出(pthread_exit())时将以key所关联的数据为参数调用destr_function(),以释放分
2012-10-06 17:57:04 2209
转载 pthread_cond_signal
/* * #define pthread_cleanup_push(routine,arg) \ * { struct _pthread_cleanup_buffer _buffer; \ * _pthread_cleanup_pu
2012-10-06 17:37:39 569
转载 pthread_join
#include #include #include struct thread_param{ char info; int num;};void* thread_fun(void* param){ struct thread_param* p; p=(struct thread_param*)param; int i; printf
2012-10-06 17:14:44 558
原创 gdb debug
break functiongdb core core 是程序非法执行后 core dump 文件gdb pid 如果你的程序是一个服务程序,指定这个服务运行时的进程ID GDB 自动attach并调试catch 捕捉程序运行时的一些事件,如:载入共享库(动态链接库) 或者 c++的异常load 加载库文件condition 修改断点号为bnum的停止条件为expre
2012-10-06 16:37:07 387
原创 pthread_once
/*** once_run()函数仅执行一次,且究竟在哪个线程中执行是不定的,尽管pthread_once(&once,once_run)出现在两个线程中*/#include #include pthread_once_t once=PTHREAD_ONCE_INIT;void once_run(void){ printf("once_ru
2012-10-06 15:33:26 882
转载 FTP嗅探器
1.原始套接字(raw socket) 1.1 原始套接字工作原理与规则 原始套接字是一个特殊的套接字类型,它的创建方式跟TCP/UDP创建方法几乎是一摸一样,例如,通过01. int sockfd;02. sockfd = socktet(AF_INET, SOCK_RAW, IPPROTO_ICMP);复制代码这两句程序你就
2012-10-06 12:52:14 10604
转载 container_of
在学习Linux驱动的过程中,遇到一个宏叫做container_of。该宏定义在include/linux/kernel.h中,首先来贴出它的代码:/** * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the me
2012-10-06 12:48:44 470
原创 proc
#include #include #include #include /proc 虚拟文件系统 用于内核向用户空间导出信息 ,是一种内核与用户新的通讯方法,对/proc的读写 即与内核交互 如/proc/meminfo 文件包含内存信息/proc 由内核控制,没有承载 /proc 的设备。因为 /proc 主要存放由内核控制的状态信息,所以大部分这些信息的逻辑位置位于
2012-10-06 11:14:24 551
转载 automake
# -*- Autoconf -*-# Process this file with autoconf to produce a configure script.AC_PREREQ(2.59)AC_INIT(test, 1.0, [email protected])AC_CONF
2012-10-06 10:09:20 415
原创 内存池技术
经典的内存池技术 经典的内存池(MemPool)技术,是一种用于分配大量大小相同的小对象的技术。通过该技术可以极大加快内存分配/释放过程。下面我们详细解释其中的奥妙。 经典的内存池只涉及两个常量:MemBlockSize、ItemSize(小对象的大小,但不能小于指针的大小,在32位平台也就是不能小于4字节),以及两个指针变量MemBlockHeader、FreeNo
2012-10-02 22:45:08 558
Visual.C..开发入行真功夫.ch05.pdf
2010-05-11
Nucleus PLUS源码分析
2010-04-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人