libPheom是Facebook发布的一个高性能的C语言并发编程框架,支持事件驱动,支持多线程,还提供了内存管理和常用数据结构,甚至是jso处理。
示例代码:
#iclude "pheom/defs.h"#iclude "pheom/job.h"#iclude "pheom/log.h"#iclude "pheom/sysutil.h"it mai(it argc, char **argv){ // Must be called prior to callig ay other pheom fuctios ph_library_iit(); // Optioal cofig file for tuig iterals ph_cofig_load_cofig_file("/path/to/my/cofig.jso"); // Eable the o-blockig IO maager ph_bio_iit(0); // Do stuff here to register cliet/server stuff. // This eables a very simple request/respose cosole // that allows you to ru diagostic commads: // `echo memory | c -UC /tmp/pheom-debug-cosole` // The code behid this is i // https://github.com/facebook/libpheom/blob/master/corelib/debug_cosole.c ph_debug_cosole_start("/tmp/pheom-debug-cosole"); // Ru ph_sched_ru(); retur 0;}
评论