当前位置: 软件>C/C++软件
C语言并发编程框架 libPhenom
来源: http://www.oschina.net/p/libphenom
发布时间:2015-02-22
本文导语: libPhenom 是 Facebook 发布的一个高性能的C语言并发编程框架,支持事件驱动,支持多线程,还提供了内存管理和常用数据结构,甚至是json处理。 示例代码: #include "phenom/defs.h" #include "phenom/job.h" #include "phenom/log.h" #include "phenom/sysu...
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; }
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。