libPhenom- C语言并发编程框架

网友投稿 927 2022-10-11

libPhenom- C语言并发编程框架

libPhenom- C语言并发编程框架

libPhenom 是 Facebook发布的一个高性能的C语言并发编程框架,支持事件驱动,支持多线程,还提供了内存管理和常用数据结构,甚至是json处理。

示例代码:

#include "phenom/defs.h"#include "phenom/job.h"#include "phenom/log.h"#include "phenom/sysutil.h"int main(int argc, char **argv){  // Must be called prior to calling any other phenom functions  ph_library_init();  // Optional config file for tuning internals  ph_config_load_config_file("/path/to/my/config.json");  // Enable the non-blocking IO manager  ph_nbio_init(0);  // Do stuff here to register client/server stuff.  // This enables a very simple request/response console  // that allows you to run diagnostic commands:  // `echo memory | nc -UC /tmp/phenom-debug-console`  // The code behind this is in  // https://github.com/facebook/libphenom/blob/master/corelib/debug_console.c  ph_debug_console_start("/tmp/phenom-debug-console");  // Run  ph_sched_run();  return 0;}

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:flume exec 监听log文件修改
下一篇:开发小程序团购(团购微信小程序开发)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~