contiki学习笔记(七)contiki系统

八、contiki进程

contiki编程的核心文档

contiki的一个进程由一个单一的原线程组成。

Files
file	process.c

contiki进程内核的实现。

file	process.h
 	
contiki进程接口的头文件。
Return values
#define	PROCESS_ERR_OK   0
 	返回值,指示操作成功。	
#define	PROCESS_ERR_FULL   1
 	返回值,指示事件队列已满。 	
 

//Process protothread functions
#define	PROCESS_BEGIN()
 	Define the beginning of a process. 
 	定义流程的开始。
#define	PROCESS_END()
 	Define the end of a process. 
 	定义流程的结束。
 	contiki的程序必须介于BEGIN和END之间
#define	PROCESS_WAIT_EVENT()
 	Wait for an event to be posted to the process. 
 	等待一个事件发布的过程。
#define	PROCESS_WAIT_EVENT_UNTIL(c)
 	Wait for an event to be posted to the process, with an extra condition. 
 	等待一个事件被发布到进程,并附加一个额外的条件。
#define	PROCESS_YIELD()
 	Yield the currently running process. 
 	生成当前正在运行的进程。
#define	PROCESS_YIELD_UNTIL(c)
 	Yield the currently running process until a condition occurs. 
 	在出现条件之前,生成当前正在运行的进程
#define	PROCESS_WAIT_UNTIL(c)
 	Wait for a condition to occur. 
 	等待条件发生
#define	PROCESS_WAIT_WHILE(c) PT_WAIT_WHILE(process_pt, c)
	重定义
#define	PROCESS_EXIT()
 	Exit the currently running process. 
#define	PROCESS_PT_SPAWN(pt, thread)
 	Spawn(产生) a protothread(原始线程) from the process. 
#define	PROCESS_PAUSE()
 	Yield the process for a short while. 
 	让这个过程持续一段时间。


Poll and exit handlers
#define	PROCESS_POLLHANDLER(handler)
 	Specify an action when a process is polled. 
 	指定进程轮询时的操作。
#define	PROCESS_EXITHANDLER(handler)
 	Specify an action when a process exits. 
 	在进程退出时指定操作。



Process declaration and definition
#define	PROCESS_THREAD(name, ev, data)
 	Define the body of a process. 
#define	PROCESS_NAME(name)
 	Declare the name of a process
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值