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

asp.net mvc 统计网站流量数据深圳做网站公司 南山

asp.net mvc 统计网站流量数据,深圳做网站公司 南山,wordpress博客文章导出,网站的电子手册用什么做的文章目录 前言本机DPDK IPC API介绍demo演示 前言 DPDK的主进程和辅助进程之间共享大页内存。关于DPDK多进程的支持文档介绍见#xff1a;47. 多进程支持。 本文介绍本机DPDK的主进程和辅助进程之间交换短消息的API的使用。 前置要求#xff1a;DPDK-Hello-World示例应用程… 文章目录 前言本机DPDK IPC API介绍demo演示 前言 DPDK的主进程和辅助进程之间共享大页内存。关于DPDK多进程的支持文档介绍见47. 多进程支持。 本文介绍本机DPDK的主进程和辅助进程之间交换短消息的API的使用。 前置要求DPDK-Hello-World示例应用程序 本机DPDK IPC API介绍 具体的API接口使用见API 手册。 第一种是消息。相关函数如下 int rte_mp_sendmsg (struct rte_mp_msg *msg)发送消息。辅助进程调用该函数发送单播消息到主进程。主进程调用该函数发送广播消息到所有辅助进程。 第二种是请求。相关函数如下 int rte_mp_request_sync (struct rte_mp_msg *req, struct rte_mp_reply *reply, const struct timespec *ts): 同步请求阻塞直到收返回内容可以设置等待时长。int rte_mp_request_async (struct rte_mp_msg *req, const struct timespec *ts, rte_mp_async_reply_t clb): 异步请求。不会阻塞。int rte_mp_action_register (const char *name, rte_mp_t action): 注册消息/请求到来时对应的响应函数。void rte_mp_action_unregister (const char *name): 取消注册的响应函数。int rte_mp_reply (struct rte_mp_msg *msg, const char *peer): 响应函数中调用该函数对请求做出回复。 不管时消息还是请求都需要填充rte_mp_msg这个结构体。要填充的字段列表如下 name- 消息名称。该名称必须与接收者的回调名称匹配。param- 消息数据最多 256 字节。len_param- 消息数据的长度。fds- 与数据一起传递的文件描述符最多 8 个 fd。num_fds- 要发送的文件描述符的数量。 可以看到主辅进程之间可以传递文件描述符这就很厉害了。消息一次最多传递256个字符传递数据能力有限。但是通过文件描述符(如socketpair创建的描述符)主辅进程通信起来就很方便了。 demo演示 不太会用大概写了一个demo(1)辅助进程发送消息给主进程其中包含一段字符串和一个文件描述符。(2)主进程收到消息后阻塞读取文件描述符。(3)辅助进程通过fd给主进程发送消息最后关闭fd(发送EOF)。 (4)可以结合epoll/libevent进一步提高代码的灵活性。 完整代码见仓库。 辅助进程代码如下。 #include common.h #include rte_eal.h #include rte_errno.hint main(int argc, char *argv[]) {int ret;// 创建pipe管道int fd[2];ret pipe(fd);if (ret 0) {fprintf(stderr, Failed to execute pipe function\n);return -1;}ret rte_eal_init(argc, argv);if (ret 0) {printf(Error message: %s\n, rte_strerror(rte_errno));return -1;}// 获取当前程序的名称char hello_msg_send[256];get_process_name(hello_msg_send, sizeof(hello_msg_send));strncat(hello_msg_send, :Hi, I am secondary.,sizeof(hello_msg_send) - strlen(hello_msg_send) - 1);// 构建发送消息struct rte_mp_msg hello;strncpy(hello.name, hello_register, sizeof(hello.name) - 1);strncpy(hello.param, hello_msg_send, sizeof(hello.param) - 1);hello.len_param strlen(hello_msg_send);hello.fds[0] fd[0];hello.num_fds 1;ret rte_mp_sendmsg(hello);if (ret 0) {printf(Error message: %s\n, rte_strerror(rte_errno));return -1;}// 通过pipe的fd,给primary发送内容const char *close_msg I(secondary) will close;int send_len strlen(close_msg);int n 0;while (n send_len) {n write(fd[1], close_msg n, sizeof(close_msg));}close(fd[1]);return 0; }主进程代码如下。 #include common.h #include rte_eal.h #include rte_errno.hint secondary_fd -1;int hello_msg_reply(const struct rte_mp_msg *msg, const void *peer) {printf(recv:);printf(%s\n, (char *)msg-param);printf(recv len %d\n, msg-len_param);secondary_fd msg-fds[0]; }int main(int argc, char *argv) {int ret rte_eal_init(argc, argv);if (ret 0) {printf(Error message: %s\n, rte_strerror(rte_errno));return -1;}rte_mp_action_register(hello_register, hello_msg_reply);while (secondary_fd 0) {sleep(1);}char buf[256];while (read(secondary_fd, buf, sizeof(buf) - 1)) {printf(%s\n, buf);}return 0; }运行输出如下。 sudo ./primary sudo ./secondary --proc-typesecondary# 主进程输入如下 recv:secondary:Hi, I am secondary. recv len 29 I(secondary) will close
文章转载自:
http://www.morning.fktlg.cn.gov.cn.fktlg.cn
http://www.morning.xzlp.cn.gov.cn.xzlp.cn
http://www.morning.bmpjp.cn.gov.cn.bmpjp.cn
http://www.morning.dfwkn.cn.gov.cn.dfwkn.cn
http://www.morning.xxknq.cn.gov.cn.xxknq.cn
http://www.morning.rchsr.cn.gov.cn.rchsr.cn
http://www.morning.zwhtr.cn.gov.cn.zwhtr.cn
http://www.morning.dlbpn.cn.gov.cn.dlbpn.cn
http://www.morning.sdhmn.cn.gov.cn.sdhmn.cn
http://www.morning.bmmhs.cn.gov.cn.bmmhs.cn
http://www.morning.wdhhz.cn.gov.cn.wdhhz.cn
http://www.morning.yqrfn.cn.gov.cn.yqrfn.cn
http://www.morning.xhddb.cn.gov.cn.xhddb.cn
http://www.morning.xqbbc.cn.gov.cn.xqbbc.cn
http://www.morning.kxryg.cn.gov.cn.kxryg.cn
http://www.morning.lpnb.cn.gov.cn.lpnb.cn
http://www.morning.mtsck.cn.gov.cn.mtsck.cn
http://www.morning.nlrxh.cn.gov.cn.nlrxh.cn
http://www.morning.jzykw.cn.gov.cn.jzykw.cn
http://www.morning.gwdkg.cn.gov.cn.gwdkg.cn
http://www.morning.wdqhg.cn.gov.cn.wdqhg.cn
http://www.morning.jtmrx.cn.gov.cn.jtmrx.cn
http://www.morning.tndhm.cn.gov.cn.tndhm.cn
http://www.morning.wcrcy.cn.gov.cn.wcrcy.cn
http://www.morning.fqpyj.cn.gov.cn.fqpyj.cn
http://www.morning.yunease.com.gov.cn.yunease.com
http://www.morning.wrqw.cn.gov.cn.wrqw.cn
http://www.morning.dlurfdo.cn.gov.cn.dlurfdo.cn
http://www.morning.hongjp.com.gov.cn.hongjp.com
http://www.morning.dtrcl.cn.gov.cn.dtrcl.cn
http://www.morning.wnhml.cn.gov.cn.wnhml.cn
http://www.morning.plfy.cn.gov.cn.plfy.cn
http://www.morning.wsyq.cn.gov.cn.wsyq.cn
http://www.morning.fykrm.cn.gov.cn.fykrm.cn
http://www.morning.kxgn.cn.gov.cn.kxgn.cn
http://www.morning.nmbbt.cn.gov.cn.nmbbt.cn
http://www.morning.dmchips.com.gov.cn.dmchips.com
http://www.morning.stfdh.cn.gov.cn.stfdh.cn
http://www.morning.lfmwt.cn.gov.cn.lfmwt.cn
http://www.morning.nqwz.cn.gov.cn.nqwz.cn
http://www.morning.sjli222.cn.gov.cn.sjli222.cn
http://www.morning.mszwg.cn.gov.cn.mszwg.cn
http://www.morning.ncfky.cn.gov.cn.ncfky.cn
http://www.morning.fbdkb.cn.gov.cn.fbdkb.cn
http://www.morning.nwjzc.cn.gov.cn.nwjzc.cn
http://www.morning.fjzlh.cn.gov.cn.fjzlh.cn
http://www.morning.bpknt.cn.gov.cn.bpknt.cn
http://www.morning.ltffk.cn.gov.cn.ltffk.cn
http://www.morning.kfcz.cn.gov.cn.kfcz.cn
http://www.morning.dswtz.cn.gov.cn.dswtz.cn
http://www.morning.fkfyn.cn.gov.cn.fkfyn.cn
http://www.morning.ssxlt.cn.gov.cn.ssxlt.cn
http://www.morning.cttti.com.gov.cn.cttti.com
http://www.morning.flchj.cn.gov.cn.flchj.cn
http://www.morning.jcwt.cn.gov.cn.jcwt.cn
http://www.morning.tdnbw.cn.gov.cn.tdnbw.cn
http://www.morning.wrlqr.cn.gov.cn.wrlqr.cn
http://www.morning.fpqsd.cn.gov.cn.fpqsd.cn
http://www.morning.ggnjq.cn.gov.cn.ggnjq.cn
http://www.morning.xwbwm.cn.gov.cn.xwbwm.cn
http://www.morning.tqdqc.cn.gov.cn.tqdqc.cn
http://www.morning.qllcm.cn.gov.cn.qllcm.cn
http://www.morning.qcslh.cn.gov.cn.qcslh.cn
http://www.morning.xrwbc.cn.gov.cn.xrwbc.cn
http://www.morning.mkzdp.cn.gov.cn.mkzdp.cn
http://www.morning.hfnbr.cn.gov.cn.hfnbr.cn
http://www.morning.xwgbr.cn.gov.cn.xwgbr.cn
http://www.morning.rsjng.cn.gov.cn.rsjng.cn
http://www.morning.plhhd.cn.gov.cn.plhhd.cn
http://www.morning.wqrk.cn.gov.cn.wqrk.cn
http://www.morning.qfgwx.cn.gov.cn.qfgwx.cn
http://www.morning.tnfyj.cn.gov.cn.tnfyj.cn
http://www.morning.smdkk.cn.gov.cn.smdkk.cn
http://www.morning.jygsq.cn.gov.cn.jygsq.cn
http://www.morning.rdxnt.cn.gov.cn.rdxnt.cn
http://www.morning.nlnmy.cn.gov.cn.nlnmy.cn
http://www.morning.zcwwb.cn.gov.cn.zcwwb.cn
http://www.morning.eshixi.com.gov.cn.eshixi.com
http://www.morning.mkfr.cn.gov.cn.mkfr.cn
http://www.morning.zdsqb.cn.gov.cn.zdsqb.cn
http://www.tj-hxxt.cn/news/266945.html

相关文章:

  • 北京网站建设 知乎网站建设有关书籍
  • 网站建设服务费开票杭州网站建设找思创网络
  • 计算机网络公司安卓优化大师手机版
  • 购物网站开发目的零基础学全屋定制设计
  • 广州软件开发公司排行榜网站内优化怎么做
  • 深圳专业网站设计哪家好系统管理下载
  • 这么做网站教程wordpress官方中文主题下载
  • 做ppt网站企业形象设计是什么意思
  • 有哪些做室内设计好用的网站网络公司是做什么的?
  • 重庆做网站letide肇庆市网站建设
  • 郑州品牌网站建设官网网站空间续费多钱一年
  • 国外的网站叫什么马鞍山的网站建设公司
  • phpcms模板行业网站淘宝联盟登记新网站
  • 国内免费视频素材无水印素材网站网站维护优化
  • 有合作社做网站得不手机端网站建设教程视频教程
  • 漳州市城乡建设局网站ui网页设计学院
  • 卧龙区网站建设哪家好管理咨询是干嘛的
  • 怎样建立门户网站卓博招聘人才网
  • 做外贸在哪个平台比较好吉林seo关键词
  • 怎么自己做企业网站论坛网站建设多少钱
  • 如何建免费的企业网站湖南省建设厅最新领导分工
  • 企业做网站系统网站如何制作浙江
  • 长沙做电商网站设计网站建设0基础学起
  • 济南做网站建设的公司电话基于phpmysql的网站开发
  • 游戏开发和网站开发网络营销的主要特点有哪些
  • 德国建设部网站asp网站怎么做三语
  • 岳阳市网站建设怎么注册域名备案
  • 广州网站制作(信科网络)重庆是哪个省属于哪个省
  • 快速建站教程四川万景建设工程有限公司网站
  • 做网站过程ui界面图标