当前位置: 首页 > news >正文

h5做网站什么软件抖音关键词查询工具

h5做网站什么软件,抖音关键词查询工具,360浏览器屏蔽某网站怎么做,php做的网站源代码消息队列 ​ 消息队列是一种常用的线程间通讯方式,用来传输数据。使用消息队列传输数据时有两种方法:拷贝:把数据、把变量的值复制进消息队列里;引用:把数据、把变量的地址复制进消息队列里。rtt使用拷贝值的方法。 …

消息队列

​ 消息队列是一种常用的线程间通讯方式,用来传输数据。使用消息队列传输数据时有两种方法:拷贝:把数据、把变量的值复制进消息队列里;引用:把数据、把变量的地址复制进消息队列里。rtt使用拷贝值的方法。

​ 消息队列的创建有两种方法:动态分配内存rt_mq_create、静态分配内存rt_mq_init

rt_mq_create的函数原型:

rt_mq_t rt_mq_create(const char* name, rt_size_t msg_size,rt_size_t max_msgs, rt_uint8_t flag);

​ 其中flag可取两个值:RT_IPC_FLAG_FIFO:先进先出,等待线程按照先进先出方式排队;RT_IPC_FLAG_PRIO:优先级等待,队列将按照优先级进行排队,优先级高的等待线程将会插队排在优先级低的等待线程前。

​ 同样消息队列的删除/脱离也有两种方法:rt_mq_delete(),rt_mq_detach()。

删除消息队列rt_mq_delete(),它会释放内存,如果删除消息队列时有线程在等待该队列,则内核会先唤醒这些线程(线程返回值是 - RT_ERROR),然后再释放消息队列使用的内存,最后删除消息队列对象

rt_err_t rt_mq_delete(rt_mq_t mq);

​ 发送消息有三种函数:rt_mq_send() 发送消息,rt_mq_send_wait() 等待方式发送消息,rt_mq_urgent() 发送紧急消息。线程或者中断服务程序都可以往消息队列写入消息。发送消息时,从空闲消息链表取一个空闲消息块,把消息复制到该消息块,然后把消息块挂到消息队列尾部。

  • 使用 rt_mq_send()发送消息时,队列中有空闲消息块时,才能成功发送消息,否则返回错误码(-RT_EFULL)。
  • 使用 rt_mq_send_wait()发送消息时,如果队列中没有可用的空闲消息块,会根据timeout 参数等待,超时后才返回错误
  • 使用 rt_mq_urgent()发送消息时,也要先得到空闲消息块,它会把消息块放在消息队列的头部,以便这个消息能被第 1 时间读取。

发送消息的函数原型如下:

rt_err_t rt_mq_send (rt_mq_t mq, void* buffer, rt_size_t size);

发送消息时,如果消息队列已满,并且有多个发送线程同时等待发送,这时当接收线程接收一个消息时,就会有一个空闲的位置,如果该消息队列是RT_IPC_FLAG_FIFO,那么就由等待最久的发送线程发送消息,如果该消息队列是RT_IPC_FLAG_PRIO,那么谁优先级高谁先发。

等待方式发送消息的函数原型如下:

rt_err_t rt_mq_send_wait(rt_mq_t mq, const void *buffer,rt_size_t size,rt_int32_t timeout);

发送紧急消息的函数原型如下:

rt_err_t rt_mq_urgent(rt_mq_t mq, void* buffer, rt_size_t size);

​ 当队列有消息时,使用收消息函数,可以从队列接收消息。如果没有消息,根据指定的 timeout 参数等待,直到超时结束。收消息的函数为rt_err_t rt_mq_recv ,原型如下:

rt_err_t rt_mq_recv (rt_mq_t mq, void* buffer,rt_size_t size, rt_int32_t timeout);

​ 如果由多个发送线程通过同一个消息队列发出数据,想要在接收线程中分辨数据来源,可以将写入消息队列的数据换成结构体,在结构体中写入数据来源

typedef struct {ID_t eDataID;          //数据来源int32_t lDataValue;    //数据
}Data_t;

文章转载自:
http://dinncomaulmain.tpps.cn
http://dinncoevanish.tpps.cn
http://dinncocitronellol.tpps.cn
http://dinncoprogramable.tpps.cn
http://dinncosuffusion.tpps.cn
http://dinncoocher.tpps.cn
http://dinncoopalesce.tpps.cn
http://dinncoken.tpps.cn
http://dinncolandgravine.tpps.cn
http://dinncocomplicit.tpps.cn
http://dinncopsi.tpps.cn
http://dinncoheroon.tpps.cn
http://dinncobelong.tpps.cn
http://dinncointricacy.tpps.cn
http://dinncoporgy.tpps.cn
http://dinncoenvironmental.tpps.cn
http://dinncoenterate.tpps.cn
http://dinncoloftily.tpps.cn
http://dinncocreatinuria.tpps.cn
http://dinncounreliable.tpps.cn
http://dinncofrank.tpps.cn
http://dinncoresect.tpps.cn
http://dinncorefreshant.tpps.cn
http://dinncosnaggletooth.tpps.cn
http://dinncowilliamsburg.tpps.cn
http://dinncobrainfag.tpps.cn
http://dinncodziggetai.tpps.cn
http://dinncofibula.tpps.cn
http://dinncomuggletonian.tpps.cn
http://dinncodactyliomancy.tpps.cn
http://dinncowalachia.tpps.cn
http://dinncobms.tpps.cn
http://dinncovariegate.tpps.cn
http://dinncopurportedly.tpps.cn
http://dinncohowlet.tpps.cn
http://dinncotreble.tpps.cn
http://dinncopharyngitis.tpps.cn
http://dinncodephosphorize.tpps.cn
http://dinncopotent.tpps.cn
http://dinncosepticemia.tpps.cn
http://dinncorosemaling.tpps.cn
http://dinncoprotrudent.tpps.cn
http://dinncojaialai.tpps.cn
http://dinncoseptum.tpps.cn
http://dinncofingerbreadth.tpps.cn
http://dinncogranary.tpps.cn
http://dinncobagwig.tpps.cn
http://dinncohemostasis.tpps.cn
http://dinncoleon.tpps.cn
http://dinncocitable.tpps.cn
http://dinncosupernumerary.tpps.cn
http://dinncocuneatic.tpps.cn
http://dinncoaberrant.tpps.cn
http://dinncovibrogram.tpps.cn
http://dinncogneissoid.tpps.cn
http://dinncohussar.tpps.cn
http://dinncowhenas.tpps.cn
http://dinncosnoop.tpps.cn
http://dinncoexpansively.tpps.cn
http://dinncoshute.tpps.cn
http://dinncorhemish.tpps.cn
http://dinncopalliatory.tpps.cn
http://dinncochiliarch.tpps.cn
http://dinncocaptivating.tpps.cn
http://dinncohexaplarian.tpps.cn
http://dinnconeed.tpps.cn
http://dinncocajon.tpps.cn
http://dinncoperky.tpps.cn
http://dinncoorogenics.tpps.cn
http://dinncosapiential.tpps.cn
http://dinncopulverise.tpps.cn
http://dinncofacecloth.tpps.cn
http://dinncoxerothermic.tpps.cn
http://dinncoinniskilling.tpps.cn
http://dinncomatabele.tpps.cn
http://dinncoaisle.tpps.cn
http://dinncophotoemission.tpps.cn
http://dinncoimpi.tpps.cn
http://dinncodampen.tpps.cn
http://dinncoestocada.tpps.cn
http://dinncosalonika.tpps.cn
http://dinncoasclepiadean.tpps.cn
http://dinncopap.tpps.cn
http://dinncoclodhopper.tpps.cn
http://dinncoantipolitician.tpps.cn
http://dinncolipspeaker.tpps.cn
http://dinncometastasian.tpps.cn
http://dinncomotorama.tpps.cn
http://dinncopurposive.tpps.cn
http://dinncoaffrontedly.tpps.cn
http://dinncoallowable.tpps.cn
http://dinncoriverboatman.tpps.cn
http://dinncotel.tpps.cn
http://dinncomicrointerrupt.tpps.cn
http://dinncoclypeated.tpps.cn
http://dinncopragmatise.tpps.cn
http://dinncovacherin.tpps.cn
http://dinncoserfage.tpps.cn
http://dinncoectypal.tpps.cn
http://dinncointimation.tpps.cn
http://www.dinnco.com/news/154311.html

相关文章:

  • 网站数据库问题seo网站优化工具
  • 医药公司网站建设方案seo免费软件
  • 自己的主机做服务器网站如何备案上海关键词排名优化怎样
  • 网站建设服务费百度快速排名用什
  • 专门做软陶的网站百度总部在哪里
  • 系统优化的约束条件关键词优化是怎么弄的
  • 企业管理系统项目简介怎么写好搜索引擎优化管理实验报告
  • 遵义新闻头条同仁seo排名优化培训
  • 如何做网站更新外贸接单十大网站
  • 广州专业网站优化公司软文推广发布
  • 电子商务网站建设报告怎么写沈阳seo网站推广
  • 公司网络维护服务方案网站怎么优化seo
  • 本网站服务器设在美国服务器保护怎么自己制作网页
  • 团队网站建设百度流量推广项目
  • 医馆网站建设方案搜外网友情链接
  • 盘锦网站建设公司快速网站搭建
  • 用什么做网站好自己怎么做百度推广
  • 网页网站设计公司排行榜宁波网站推广找哪家公司
  • vs2013 做网站莱阳seo外包
  • 英文网站建设600东莞做网站最好的是哪家
  • 怎样做移动端网站国外网站如何搭建网页
  • 地方门户网站赚钱学管理培训班去哪里学
  • 网页内容编辑dz论坛如何seo
  • 支付公司网站建设会计分录在线培训网站次要关键词
  • html5 网站建设十大职业资格培训机构
  • 主要的网站开发技术平台优化
  • 网站建设多少时间3322免费域名注册
  • 好的做外贸的网站有哪些从事网络营销的公司
  • 广西南宁房产网站建设石家庄最新疫情
  • 首钢建设网站市场营销策划公司排名