摘要:
从msdn上看二者的解释:postmessage :Places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message.To post a message in the message queue associated with a thread, use thePostThreadMessagefunction.The 阅读全文
摘要:
摘自stackflow的回答,主要从架构上说明了二者的区别:As for design philosophy, libev was created to improve on some of the architectural decisions in libevent, for example, global variable usage made it hard to use libevent safely in multithreaded environments, watcher structures are big because they combine I/O, time and 阅读全文
摘要:
#define ev_io_init(ev,cb,fd,events) / do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } while (0)/看到没,这就是C语言的恶心指出,尼玛找个定一点都要用全局搜索字符,才找到这个宏。好吧,看它都做了写神马东东:ev_init ((ev), (cb));就是把watcher进行初始化,把回调设置进去;ev是神马玩意呢,就是ev_io:/* invoked when fd is either EV_READable or EV_WRITEable *//* reven... 阅读全文
摘要:
/* these may evaluate ev multiple times, and the other arguments at most once *//* either use ev_init + ev_TYPE_set, or the ev_TYPE_init macro, below, to first initialise a watcher */#define ev_init(ev,cb_) do { \ ((ev_watcher *)(void *)(ev))->active = \ ((ev_watcher *)(void *)(ev))... 阅读全文
摘要:
尼玛 C语言学不好真是桑心呐!看了libev的代码有一种想死的感觉,但是还是要硬着头皮看下去,一定看完!/* initialise a loop structure, must be zero-initialised */static void loop_init ( unsigned int flags){ if (!loop->backend) { origflags = flags;#if EV_USE_REALTIME if (!have_realtime) { struct timespec ts; if ... 阅读全文
摘要:
转自:酷壳http://coolshell.cn/articles/8990.html感谢网友full_of_bull投递此文(注:此文最初发表在这个这里,我对原文后半段修改了许多,并加入了插图)Linus大婶在slashdot上回答一些编程爱好者的提问,其中一个人问他什么样的代码是他所喜好的,大婶表述了自己一些观点之后,举了一个指针的例子,解释了什么才是core low-level coding。下面是Linus的教学原文及翻译——“At the opposite end of the spectrum, I actually wish more people understood the 阅读全文
摘要:
Wait functionsallow a thread to block its own execution. The wait functions do not return until the specified criteria have been met. The type of wait function determines the set of criteria used. When a wait function is called, it checks whether the wait criteria have been met. If the criteria have 阅读全文
摘要:
Asynchronous I/O, ornon-blocking I/O, in computer science, is a form ofinput/outputprocessing that permits other processing to continue before thetransmissionhas finished.Input and output (I/O) operations on a computer can be extremely slow compared to the processing of data. An I/O device can incor 阅读全文
摘要:
A quick note about usages of fields. My experience is that many who implement FIX do it slightly differently. So be aware that though I am trying to explain correct usage you may find that there are differences between implementations. When I connect to a new broker I get a FIX specification which d 阅读全文
摘要:
YourfromApp()callback gets aMessageobject. That message is actually a NewOrderSingle or ExecutionReport or something. Rather than making you figure it out, QF lets you inherit fromMessageCracker. To use it, callcrack()in yourfromApp(), as follows:void fromApp( const FIX::Message& message, const 阅读全文
摘要:
We are looking for Senior Windows C++ developers with strong network programming experience. The senior developer will focus on specifying, designing, prototyping and implementing the industry-leading SaaS-based datacenter monitoring solution for Windows platformQualifications:BS/MS degree and 3+ ye 阅读全文
摘要:
昨天同事问到:单例模式和全局变量有何区别?全局变量可以创建多个实例,但单例模式只能创建一个(每次得调用GetInstance()之类的唯一方法得到);而全局变量的class,你可以在任何包含它的地方实例化对象,A a,A b; and so on;但对于单例模式,无论在哪:A a =GetInstance(), A b =GetInstance();除此之外,更无他法,因此单例模式自己负责创建唯一实例;你绝不可能创建 A a;因为它的构造函数是private的。另外全局的话,就只有一般性,木有什么变化了;在想要的地方给予一定的参数来得到这个唯一对象,应该才是满足需要的。当然全局对象无论用到与否 阅读全文