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

html网站欣赏网站seo主要是做什么的

html网站欣赏,网站seo主要是做什么的,广告设计就业好找吗,个人做的网站overwrite_buffer 类 concurrency::overwrite_buffer 类与 unbounded_buffer 类类似,只不过 overwrite_buffer 对象仅存储一条消息。 此外,当目标接收来自 overwrite_buffer 对象的消息时,不会从缓冲区中删除该消息。 因此,多个目…
overwrite_buffer 类

concurrency::overwrite_buffer 类与 unbounded_buffer 类类似,只不过 overwrite_buffer 对象仅存储一条消息。 此外,当目标接收来自 overwrite_buffer 对象的消息时,不会从缓冲区中删除该消息。 因此,多个目标将接收到该消息的副本。

如果你要将多条消息传递到另一个组件,而该组件只需要最新的值,则 overwrite_buffer 类很有用。 需向多个组件广播消息时,此类也很有用。

示例

以下示例使用基本结构来演示如何使用 overwrite_buffer 类。 此示例将三个值发送到 overwrite _buffer 对象,然后从该对象读取当前值三次。 此示例类似于 unbounded_buffer 类的示例。 但是,overwrite_buffer 类仅存储一条消息。 此外,运行时不会在读取消息后从 overwrite_buffer 对象中删除该消息。

// overwrite_buffer-structure.cpp
// compile with: /EHsc
#include <agents.h>
#include <iostream>using namespace concurrency;
using namespace std;int wmain()
{// Create an overwrite_buffer object that works with// int data.overwrite_buffer<int> item;// Send a few items to the overwrite_buffer object.send(item, 33);send(item, 44);send(item, 55);// Read the current item from the overwrite_buffer object and print// it to the console three times.wcout << receive(item) << endl;wcout << receive(item) << endl;wcout << receive(item) << endl;
}

该示例产生下面的输出:

555555
single_assignment 类

concurrency::single_assignment 类与 overwrite_buffer 类类似,只不过只能写入到 single_assignment 对象一次。 与 overwrite_buffer 类相似,在目标收到来自 single_assignment 对象的消息时,不会从该目标删除此消息。 因此,多个目标将接收到该消息的副本。 如果你要向多个组件广播一条消息时,single_assignment 类很有用。

示例

以下示例使用基本结构来演示如何使用 single_assignment 类。 此示例将三个值发送到 single_assignment 对象,然后从该对象读取当前值三次。 此示例类似于 overwrite_buffer 类的示例。 尽管 overwrite_buffer 和 single_assignment 类都存储一条消息,但只能写入到 single_assignment 类一次。

// single_assignment-structure.cpp
// compile with: /EHsc
#include <agents.h>
#include <iostream>using namespace concurrency;
using namespace std;int wmain()
{// Create an single_assignment object that works with// int data.single_assignment<int> item;// Send a few items to the single_assignment object.send(item, 33);send(item, 44);send(item, 55);// Read the current item from the single_assignment object and print// it to the console three times.wcout << receive(item) << endl;wcout << receive(item) << endl;wcout << receive(item) << endl;
}

该示例产生下面的输出:

333333
call 类

concurrency::call 类充当消息接收方,它在接收数据时执行工作函数。 此工作函数可以是 lambda 表达式、函数对象或函数指针。 call 对象的行为与普通函数调用不同,因为它与向它发送消息的其他组件并行运行。 如果 call 对象在接收消息时正在执行工作,则它会将该消息添加到队列。 每个 call 对象按消息的接收顺序处理排队的消息。

示例

以下示例使用基本结构来演示如何使用 call 类。 此示例创建一个 call 对象,它会将收到的每个值输出到控制台。 然后,该示例将三个值发送到 call 对象。 由于 call 对象在单独的线程上处理消息,因此此示例还使用了计数器变量和 event 对象来确保 call 对象在 wmain 函数返回之前处理所有消息。

// call-structure.cpp
// compile with: /EHsc
#include <agents.h>
#include <iostream>using namespace concurrency;
using namespace std;int wmain()
{// An event that is set when the call object receives all values.event received_all;// Counts the long receive_count = 0L;long max_receive_count = 3L;// Create an call object that works with int data.call<int> target([&received_all,&receive_count,max_receive_count](int n) {// Print the value that the call object receives to the console.wcout << n << endl;// Set the event when all messages have been processed.if (++receive_count == max_receive_count)received_all.set();});// Send a few items to the call object.send(target, 33);send(target, 44);send(target, 55);// Wait for the call object to process all items.received_all.wait();
}

该示例产生下面的输出: 

334455
http://www.ds6.com.cn/news/28561.html

相关文章:

  • 南充市企业网站建设百度关键词指数工具
  • 网站查询域名解析ip今日新闻国际头条新闻
  • wordpress内存使用seo标签怎么优化
  • 浙江邮电工程建设有限公司网站seo资料网
  • 网站架构演变流程河南省疫情最新情况
  • 上海网站制作费用网络营销方法有哪几种
  • 做百度推广首先要做网站吗百度推广多少钱
  • 怎么用源码做网站视频北京新闻最新消息
  • 如何做黄色网站赚钱网站seo分析案例
  • wordpress支持伪静态seo是什么意思蜘蛛屯
  • 高速公路建设网站北京网站建设专业公司
  • wordpress 日志路径济南seo排名搜索
  • 宁波网站建设的企业营销推广计划
  • 用凡科建设网站旺道seo推广
  • 做网站需要哪些基本功能杭州小程序建设公司
  • 在那个网站做直播好赚钱吗seo点击
  • 哪个网站做售楼推广好靠谱的广告联盟
  • 网站建设答辩恩施seo整站优化哪家好
  • 自己做网站需要花钱吗搜索引擎优化百度百科
  • 网站开发课程安排全网营销公司
  • 营销品牌有哪些seo广告投放
  • 网页设计英文seo初学教程
  • 服装服饰东莞网站建设营销网站建设价格
  • 丹阳高铁站对面的规划a5站长网网站交易
  • 手机可做兼职的网站百度怎么提交收录
  • 免费开源企业网站程序成都关键词优化报价
  • 网站背景磨砂灰背景怎么做网站内容检测
  • 网站推广其他方案内容如何在网上推广自己的产品
  • 博客网站做外贸可以吗网络营销的现状分析
  • 柳林网站建设中国网络营销公司排名