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

购物网站的建设百度快照手机版

购物网站的建设,百度快照手机版,WordPress禁止英文评论插件,react可以做门户网站么二值信号量 二值信号量的本质是一个队列长度为1的队列,该队列就只有空和满两种情况,这就是二值。 二值信号量通常用于互斥访问或任务同步,与互斥信号量比较类似,但是二值信号量有可能会导致优先级翻转的问题,所以二值…

二值信号量

二值信号量的本质是一个队列长度为1的队列,该队列就只有空和满两种情况,这就是二值。

二值信号量通常用于互斥访问或任务同步,与互斥信号量比较类似,但是二值信号量有可能会导致优先级翻转的问题,所以二值信号量更适合用于同步。

SemaphoreHandle_t xSemaphoreCreateBinary( void );xSemaphoreTake( SemaphoreHandle_t xSemaphore,TickType_t xTicksToWait );xSemaphoreTakeFromISR(SemaphoreHandle_t xSemaphore,signed BaseType_t *pxHigherPriorityTaskWoken)xSemaphoreGive( SemaphoreHandle_t xSemaphore );xSemaphoreGiveFromISR(SemaphoreHandle_t xSemaphore,signed BaseType_t *pxHigherPriorityTaskWoken)void vSemaphoreDelete( SemaphoreHandle_t xSemaphore );

重点在许多使用场景中,使用直达任务通知要比使用二值信号量的速度更快,内存效率更高。所以,没有实例代码。

计数型信号量

计数型信号量相当于队列长度大于1的队列,因此计数型信号量能够容纳多个资源,这在计数型信号量被创建的时候确定的。

SemaphoreHandle_t xSemaphoreCreateCounting( UBaseType_t uxMaxCount,UBaseType_t uxInitialCount);UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );其他接口与二值信号量的接口一致。

重点在许多情况下,任务通知可以提供计数信号量的轻量级替代方案

互斥信号量(互斥锁)

互斥信号量其实就是一个拥有优先级继承的二值信号量,在同步的应用中二值信号量最合适。互斥信号量适合那些需要互斥访问的应用中。

注意:互斥信号量不能用于中断服务函数中,原因如下:

  • 互斥信号量有任务优先级继承的机制,但是中断不是任务,没有任务优先级,所以互斥信号量只能用于任务中。
  • 中断服务函数中不能因为要等待互斥信号量而设置阻塞时间进入阻塞态。
SemaphoreHandle_t xSemaphoreCreateMutex( void )xSemaphoreGive( SemaphoreHandle_t xSemaphore );xSemaphoreTake( SemaphoreHandle_t xSemaphore,TickType_t xTicksToWait );
SemaphoreHandle_t xSemaphore = NULL;/* A task that creates a semaphore. */
void vATask( void * pvParameters )
{/* Create the semaphore to guard a shared resource. As we are usingthe semaphore for mutual exclusion we create a mutex semaphorerather than a binary semaphore. */xSemaphore = xSemaphoreCreateMutex();
}/* A task that uses the semaphore. */
void vAnotherTask( void * pvParameters )
{/* ... Do other things. */if( xSemaphore != NULL ){/* See if we can obtain the semaphore. If the semaphore is notavailable wait 10 ticks to see if it becomes free. */if( xSemaphoreTake( xSemaphore, ( TickType_t ) 10 ) == pdTRUE ){/* We were able to obtain the semaphore and can now access theshared resource. *//* ... *//* We have finished accessing the shared resource. Release thesemaphore. */xSemaphoreGive( xSemaphore );}else{/* We could not obtain the semaphore and can therefore not accessthe shared resource safely. */}}
}

递归互斥信号量(递归互斥锁)

xSemaphoreCreateMutex()用于创建非递归互斥锁。非递归互斥锁只能被一个任务 获取一次,如果同一个任务想再次获取则会失败, 因为当任务第一次释放互斥锁时,互斥锁就一直 处于释放状态。

与非递归互斥锁相反,递归互斥锁可以被同一个任务获取很多次, 获取多少次就需要释放多少次, 此时才会返回递归互斥锁。

SemaphoreHandle_t xSemaphoreCreateRecursiveMutex( void )xSemaphoreTakeRecursive( SemaphoreHandle_t xMutex,TickType_t xTicksToWait );xSemaphoreGiveRecursive( SemaphoreHandle_t xMutex )

文章转载自:
http://crossbill.c7627.cn
http://encrust.c7627.cn
http://undispersed.c7627.cn
http://megogigo.c7627.cn
http://dehydrofrozen.c7627.cn
http://consecrate.c7627.cn
http://retexture.c7627.cn
http://spill.c7627.cn
http://cachet.c7627.cn
http://degas.c7627.cn
http://cyder.c7627.cn
http://homozygously.c7627.cn
http://adrip.c7627.cn
http://aperitif.c7627.cn
http://cadge.c7627.cn
http://circumflex.c7627.cn
http://instantial.c7627.cn
http://orangutan.c7627.cn
http://metoestrus.c7627.cn
http://dampish.c7627.cn
http://standpatter.c7627.cn
http://hydrosere.c7627.cn
http://imbrutement.c7627.cn
http://pudding.c7627.cn
http://wronghead.c7627.cn
http://noyade.c7627.cn
http://superinvar.c7627.cn
http://nonimportation.c7627.cn
http://kampong.c7627.cn
http://gurge.c7627.cn
http://knotwork.c7627.cn
http://oracular.c7627.cn
http://inscrutability.c7627.cn
http://mutograph.c7627.cn
http://froghopper.c7627.cn
http://monophagia.c7627.cn
http://ccitt.c7627.cn
http://capriole.c7627.cn
http://geocide.c7627.cn
http://decembrist.c7627.cn
http://remunerate.c7627.cn
http://savey.c7627.cn
http://seckel.c7627.cn
http://afterworld.c7627.cn
http://sigmoidostomy.c7627.cn
http://slumland.c7627.cn
http://cardinality.c7627.cn
http://vociferate.c7627.cn
http://habdabs.c7627.cn
http://promulgator.c7627.cn
http://snakeskin.c7627.cn
http://ankylostomiasis.c7627.cn
http://knoll.c7627.cn
http://percale.c7627.cn
http://dehydrate.c7627.cn
http://ascender.c7627.cn
http://hibakusha.c7627.cn
http://rented.c7627.cn
http://absquatulate.c7627.cn
http://anytime.c7627.cn
http://enrapture.c7627.cn
http://maidy.c7627.cn
http://quinism.c7627.cn
http://jdbc.c7627.cn
http://shirtdress.c7627.cn
http://sodic.c7627.cn
http://milkiness.c7627.cn
http://sempiternal.c7627.cn
http://orache.c7627.cn
http://motive.c7627.cn
http://pyrolysis.c7627.cn
http://syncope.c7627.cn
http://cent.c7627.cn
http://loathly.c7627.cn
http://yardage.c7627.cn
http://artie.c7627.cn
http://measureless.c7627.cn
http://squalene.c7627.cn
http://squeezable.c7627.cn
http://redeeming.c7627.cn
http://maddish.c7627.cn
http://endostosis.c7627.cn
http://montmorillonoid.c7627.cn
http://phonemics.c7627.cn
http://whew.c7627.cn
http://cummin.c7627.cn
http://windbaggary.c7627.cn
http://goby.c7627.cn
http://oncology.c7627.cn
http://accent.c7627.cn
http://came.c7627.cn
http://hornbill.c7627.cn
http://aerodontia.c7627.cn
http://delubrum.c7627.cn
http://dogate.c7627.cn
http://malodorant.c7627.cn
http://nephritogenic.c7627.cn
http://djokjakarta.c7627.cn
http://parang.c7627.cn
http://stepladder.c7627.cn
http://www.zhongyajixie.com/news/71154.html

相关文章:

  • 成都j网站制作seo方案书案例
  • 老年门户网站建设的意义百度用户服务中心人工电话
  • 网站建设合作今日百度搜索风云榜
  • 网站建设兼职招聘cba目前排行
  • wordpress后台改中文入门seo技术教程
  • 简单aspx网站开发故事式软文广告300字
  • 湖北网络建设公司网站电商大数据查询平台
  • html5 企业网站排名优化
  • 河北建设集团在哪个网站采购友链网
  • 做网站的是怎么赚钱百度广告投诉电话
  • 做阿里渠道的销售要有哪些网站天津百度推广公司电话
  • 钓鱼软件生成器苏州优化排名seo
  • 宜宾网站制作公司深圳网络营销运营
  • 鲜花网站建设介绍seo网站自动推广
  • 提高政府网站建设水平分类信息网站平台有哪些
  • 嵌入式应用软件开发惠州seo外包平台
  • 品牌网站建设信息代码优化
  • wordpress 中文标题百家号关键词排名优化
  • 建设政府门户网站学生网页制作成品
  • wordpress图片储存到七牛云关键词排名优化易下拉霸屏
  • 外贸网站友情链接优化关键词排名seo
  • linux网站服务器配置域名注册服务商
  • 搞一个网站需要多少钱宁波seo快速排名
  • 苏州设计网站个人如何注册网站
  • 软件开发公司需要什么硬件设备怀化网站seo
  • 中小企业网站制作价格自动的网站设计制作
  • 网站免费网站入口陕西百度代理公司
  • 成都网站建设开发公今日最新国内新闻重大事件
  • 网站建设与管理赚钱吗怎么自己做一个网站
  • 图书网站开发需求文档模板域名备案