亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? real-time experiment #4 message queues.htm

?? 該文檔是學習在Vxworks上進行編程開發的入門教材。
?? HTM
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0069)http://www.rt.db.erau.edu/experiments/vx/mesgQueues/Experiment-4.html -->
<HTML><HEAD><TITLE>Real-Time Experiment #4: Message Queues</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>ticks 
<CENTER>
<H1>Embry-Riddle Real-Time Laboratory Experiment<BR>Experiment #4<BR>Message 
Queues </H1></CENTER>
<HR SIZE=3>

<H2>Introduction</H2>
<P></P>In VxWorks, the primary intertask communication mechanism within a single 
CPU is <EM>message queues</EM>. Message queues allow a variable number of 
messages, each of variable length, to be queued(FIFO or priority based). Any 
task can send a message to a message queue and any task can receive a message 
from a message queue. Multiple tasks can send to and receive from the same 
message queue. Two way communication between two tasks generally requires two 
message queues, one for each direction.
<P></P>
<HR SIZE=3>

<H2>Objectives</H2>The following are the primary objectives of this experiment: 
<UL>
  <LI>To demonstrate the use of VxWorks message queues. </LI></UL>
<P></P>
<HR SIZE=3>

<H2>Description</H2>Wind message queues are created and deleted with the 
following routines: 
<UL>
  <LI><EM>msgQCreate(int maxMsgs, int maxMsgLength, int options)</EM>: Allocate 
  and initialize a message queue. </LI></UL>
<UL>
  <LI><EM>msgQDelete(MSG_Q_ID msgQId)</EM>: Terminate and free a message queue. 
  </LI></UL>
<UL>
  <LI><EM>msgQSend(MSG_Q_ID msgQId, char *Buffer, UINT nBytes, int timeout, int 
  priority)</EM>: Send a message to a message queue. </LI></UL>
<UL>
  <LI><EM>msgQReceive(MSG_Q_ID msgQId, char *Buffer, UINT nBytes, int 
  timeout)</EM> Send a message to a message queue. </LI></UL>This library provides 
messages that are queued in FIFO order, with a single exception: there are two 
priority levels, and messages marked as high priority are attached to the head 
of the queue.
<P></P>A message queue is created with <EM>msgQCreate()</EM>. Its parameters 
specify the maximum number of messages that can be queued in the message queue 
and the maximum length in bytes of each message.
<P></P>A task sends a message to a message queue with <EM>msgQSend()</EM>. If no 
tasks are waiting for messages on that queue, the message is added to the 
queue's buffer of messages. If any tasks are waiting for a message from that 
message queue, the message is immediately delivered to the first waiting task.
<P></P>A task receives a message from a message queue with 
<EM>msgQReceive()</EM>. If messages are already available in the queue's buffer, 
the first message is immediately dequeued and returned to the caller. If no 
messages are available, then the calling task blocks and is added to a queue of 
tasks waiting for messages. The queue of waiting tasks can be ordered either by 
task priority or FIFO, as specified when the queue is created. 
<P></P>
<UL>
  <LI><EM><B>Timeouts</B></EM>: Both <EM>msgQSend()</EM> and 
  <EM>msgQReceive()</EM> take timeout parameters. The timeout parameter 
  specifies how many ticks(clock ticks per second) to wait for space to be 
  available when sending a message and to wait for a message to be available 
  when receiving a message. </LI></UL>
<UL>
  <LI><EM><B>Urgent Messages</B></EM>: The <EM>msgQSend()</EM> function can 
  specify the priority of a message either as normal <B>MSG_PRI_NORMAL</B> or 
  urgent <B>MSG_PRI_URGENT</B>. Normal priority messages are added to the tail 
  of the message queue, while urgent priority messages are added to the head of 
  the message queue. </LI></UL>
<P></P><B>1. Example</B>
<P></P><PRE>-------------------------------------------------------------------------------------
/* includes */
#include "vxWorks.h"
#include "msgQLib.h"

/* function prototypes */
void taskOne(void);
void taskTwo(void);

/* defines */
#define MAX_MESSAGES 100
#define MAX_MESSAGE_LENGTH 50

/* globals */
MSG_Q_ID mesgQueueId;

void message(void) /* function to create the message queue and two tasks */
{
int taskIdOne, taskIdTwo;

/* create message queue */
if ((mesgQueueId = msgQCreate(MAX_MESSAGES,MAX_MESSAGE_LENGTH,MSG_Q_FIFO))
	== NULL)
	printf("msgQCreate in failed\n");


/* spawn the two tasks that will use the message queue */
if((taskIdOne = taskSpawn("t1",90,0x100,2000,(FUNCPTR)taskOne,0,0,0,0,0,0,0,
	0,0,0)) == ERROR)
	printf("taskSpawn taskOne failed\n");
if((taskIdTwo = taskSpawn("t2",90,0x100,2000,(FUNCPTR)taskTwo,0,0,0,0,0,0,0,
	0,0,0)) == ERROR)
	printf("taskSpawn taskTwo failed\n");
}


void taskOne(void) /* task that writes to the message queue */
{
char message[] = "Received message from taskOne";

/* send message */
if((msgQSend(mesgQueueId,message,MAX_MESSAGE_LENGTH, WAIT_FOREVER, 
	MSG_PRI_NORMAL)) == ERROR)
	printf("msgQSend in taskOne failed\n");
}

void taskTwo(void) /* tasks that reads from the message queue */
{
char msgBuf[MAX_MESSAGE_LENGTH];

/* receive message */
if(msgQReceive(mesgQueueId,msgBuf,MAX_MESSAGE_LENGTH, WAIT_FOREVER) 
		== ERROR)
	printf("msgQReceive in taskTwo failed\n");	
else
		printf("%s\n",msgBuf); 
msgQDelete(mesgQueueId); /* delete message queue */
}
-------------------------------------------------------------------------------------
</PRE>
<P></P>
<HR SIZE=3>

<H2>Procedures</H2>1. Copy the source code in the example and compile it. 
<P></P>2. Load the object file onto the target machine.
<P></P>3. Run the examples by executing the main routine("message") of the 
example on WindSh terminal. 
<P></P>Note: Make sure you have redirected I/O, otherwise you won't see the 
results of the printf commands. 
<HR SIZE=3>

<H2>Follow On Experiment</H2>Experiment 1. Modify the above program so that 
taskTwo can send a string message ("Received message from taskTwo") to taskOne. 
Have taskOne print the message sent from taskTwo.
<P></P>Experiment 2. Are there any advantages or disadvantages to using message 
queues as opposed to global variables as a message passing scheme? Explain your 
answer.
<P></P>
<HR SIZE=3>

<H2>Additional Information</H2>Refer to VxWorks User's Manual and Reference 
Manual.
<P></P>
<HR SIZE=3>

<CENTER>
<H4><A 
href="http://www.rt.db.erau.edu/experiments/vx/toc/TableOfContents.html">Return 
to Primary Table of Contents </A></H4></CENTER>
<HR SIZE=3>

<CENTER>Last Updated: 17 March 1997<BR><EM>Created by: Dan Eyassu</EM><BR><A 
href="mailto:eyassud@db.erau.edu">eyassud@db.erau.edu</A><BR></CENTER></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品在线一区二区| 亚洲欧美在线另类| 亚洲视频你懂的| 蜜臀久久99精品久久久画质超高清| 国产99久久久精品| 日韩欧美中文字幕精品| 亚洲综合在线电影| 成人免费看黄yyy456| 日韩欧美国产电影| 亚洲成人自拍偷拍| 97精品国产97久久久久久久久久久久| 日韩视频免费观看高清完整版 | 国产麻豆精品在线| 欧美一区二区三区不卡| 夜夜嗨av一区二区三区中文字幕| 国产福利一区二区三区视频| 欧美一区二区成人6969| 亚洲成人动漫一区| 91传媒视频在线播放| 国产精品美女久久久久高潮| 国产寡妇亲子伦一区二区| 日韩亚洲欧美一区| 日韩电影免费在线看| 在线观看日韩av先锋影音电影院| 日韩一区中文字幕| 不卡av免费在线观看| 欧美激情综合五月色丁香| 国产一区二区成人久久免费影院| 欧美一区二区精品| 奇米888四色在线精品| 欧美日韩和欧美的一区二区| 亚洲一区二区欧美日韩| 日本韩国欧美在线| 亚洲图片有声小说| 欧美精品在线视频| 免费在线观看不卡| 日韩精品一区二区三区在线播放| 日韩av一级片| 欧美本精品男人aⅴ天堂| 青青草精品视频| 日韩欧美国产综合一区| 激情综合色综合久久| 精品国产亚洲在线| 国产麻豆午夜三级精品| 中文字幕欧美激情| 色婷婷久久久综合中文字幕| 亚洲精品一二三| 欧美日韩不卡视频| 精品一区二区成人精品| 国产亚洲成aⅴ人片在线观看 | 欧美国产成人在线| 波多野结衣亚洲| 一区二区免费视频| 欧美一区二区三区在线电影| 国产综合色在线视频区| 欧美经典一区二区| 日本韩国一区二区三区视频| 日韩影视精彩在线| 久久久三级国产网站| 99国产精品99久久久久久| 亚洲电影一级黄| 亚洲精品一区在线观看| 94色蜜桃网一区二区三区| 亚洲成av人**亚洲成av**| 精品国产91乱码一区二区三区| 国产电影精品久久禁18| 亚洲人吸女人奶水| 日韩午夜激情av| www.色综合.com| 丝瓜av网站精品一区二区 | 亚洲天堂免费在线观看视频| 欧美日韩精品综合在线| 国产精品中文字幕日韩精品 | 欧洲精品中文字幕| 久久99久久久欧美国产| 亚洲人成7777| 久久免费国产精品| 精品视频1区2区| 成人精品鲁一区一区二区| 午夜av区久久| 一区精品在线播放| 久久亚洲捆绑美女| 精品视频色一区| 99在线精品免费| 国产在线乱码一区二区三区| 亚洲国产精品精华液网站| 欧美国产激情二区三区| 欧美成人猛片aaaaaaa| 色综合天天综合网天天狠天天 | 国产精品美女一区二区| 日韩欧美中文字幕精品| 欧美午夜宅男影院| 成人网在线播放| 国内一区二区在线| 日韩精品乱码免费| 亚洲国产精品一区二区久久恐怖片| 国产视频亚洲色图| 久久亚洲一区二区三区明星换脸| 欧美日韩一二三区| 91免费观看国产| 99在线精品一区二区三区| 国产精品一区二区你懂的| 狂野欧美性猛交blacked| 亚洲成av人片一区二区三区| 一区二区不卡在线播放| 亚洲色图视频免费播放| 国产精品国产三级国产普通话三级| ww亚洲ww在线观看国产| 欧美一级二级三级乱码| 91麻豆精品国产91| 欧美日韩国产免费| 欧美日韩黄色影视| 欧美精品粉嫩高潮一区二区| 欧美日韩你懂的| 欧美美女直播网站| 欧美高清hd18日本| 91精品视频网| 精品久久久久久无| 2023国产精品| 国产亚洲成年网址在线观看| 国产日韩欧美精品电影三级在线| 精品国产百合女同互慰| 久久久久99精品国产片| 欧美激情在线观看视频免费| 欧美激情综合五月色丁香小说| 国产婷婷精品av在线| 国产精品久久久久久久第一福利 | 国产91丝袜在线播放0| 国产精品一区免费视频| 成人av免费观看| 在线观看视频欧美| 欧美肥胖老妇做爰| 欧美mv和日韩mv的网站| 久久久777精品电影网影网| 国产精品的网站| 一区二区三区.www| 日本亚洲三级在线| 狠狠色综合日日| 本田岬高潮一区二区三区| 在线精品视频一区二区三四| 91精品国产免费| 久久人人爽爽爽人久久久| 亚洲欧洲一区二区三区| 婷婷综合五月天| 国产麻豆精品在线| 色综合久久久久久久久久久| 欧美精品色综合| 国产午夜精品久久久久久免费视 | 久久久精品一品道一区| 成人欧美一区二区三区白人| 午夜电影网亚洲视频| 国产一区二区三区免费在线观看| 91在线视频播放地址| 欧美理论在线播放| 中文字幕欧美日韩一区| 午夜成人免费视频| 不卡的av网站| 精品免费99久久| 一区二区三区欧美日| 九九在线精品视频| 99久久精品费精品国产一区二区| 91精品蜜臀在线一区尤物| 国产精品电影一区二区三区| 免费观看一级特黄欧美大片| 99riav久久精品riav| 久久综合九色综合久久久精品综合 | 欧美久久一区二区| 国产精品久久久久久户外露出 | 中文字幕日韩一区| 精品中文字幕一区二区 | 成年人网站91| 欧美mv日韩mv国产网站app| 亚洲国产另类av| av一区二区不卡| 国产午夜精品一区二区三区视频 | 一区二区三区四区亚洲| 国产精品一区一区三区| 欧美一区二区视频在线观看2020| 亚洲人成精品久久久久久| 国产一区二区三区av电影| 91精品国产日韩91久久久久久| 一区二区三区高清| 99久久er热在这里只有精品15 | 91精品国产入口| 亚洲国产一区视频| 在线免费精品视频| 亚洲免费伊人电影| 一本一道久久a久久精品综合蜜臀| 久久品道一品道久久精品| 麻豆精品精品国产自在97香蕉| 欧美日韩视频在线观看一区二区三区| 亚洲欧美日韩成人高清在线一区| 丰满亚洲少妇av| 国产精品每日更新| 国产.欧美.日韩| 欧美激情资源网| 成人久久久精品乱码一区二区三区| 久久久久高清精品| 丁香婷婷综合五月| 国产精品久久久久国产精品日日 |