
# 队列调测方法
#### 功能说明
队列是一种生产者消费者模型，生产者生产消息放入队列，等待被消费者使用。如果队列已满，生产者被挂起，如果队列已空，消费者被挂起。Huawei LiteOS中使用队列传递消息时，可以设置超时时间，队列的主要作用是实现任务间的异步通信。通过Shell命令[queue](https://support.huaweicloud.com/maintenance-LiteOS/zh-cn_topic_0312409050.html)可以查看队列的使用情况。
#### 使用方法
queue命令依赖LOSCFG_DEBUG_QUEUE，使用时需要在menuconfig中开启"Enable Queue Debugging"。
```
Debug ---> Enable a Debug Version ---> Enable Debug LiteOS Kernel Resource ---> Enable Queue Debugging
```
#### 使用实例
在Shell窗口中执行命令queue，打印系统中的队列信息如下：
![](https://support.huaweicloud.com/maintenance-LiteOS/zh-cn_image_0304264868.png)
其输出项的含义见[queue-输出说明](https://support.huaweicloud.com/maintenance-LiteOS/zh-cn_topic_0312409050.html#ZH-CN_TOPIC_0312409050__zh-cn_topic_0175230344_section20711626163713)，调试过程中主要使用上图中的标识项TaskEntry of creator，即创建队列的接口函数地址（0x0x80242df8）。在.asm反汇编文件（默认在Huawei_LiteOS/out/\<platform\>目录下，其中的platform为具体的平台名）中找到该地址，可以看到创建队列的函数名，比如这里的app_init（0x0x80242df8），见下图。
![](https://support.huaweicloud.com/maintenance-LiteOS/zh-cn_image_0304264128.png)
