转载请注明链接与作者huihui1988QThread的用法其实比较简单,只需要派生一个QThread的子类,实现其中的run虚函数就大功告成, 用的时候创建该类的实例,调用它的start方法即可。但是run函数使用时有一点需要注意,即在其中不能创建任何gui线程(诸如新建一个QWidget或者QD... Read More
posted @ 2015-11-17 22:53 findumars Views(2697) Comments(0) Diggs(0)
epoll相对于poll和select这两个多路复用的I/O模型更加的高效。epoll的函数很简单,麻烦的地方在于水平触发和边沿触发。用张图来说明下ET(边沿)只是在状态反转时触发,比如从不可读到可读。而LT(水平)就是如果可读,就会一直触发。所以在使用ET的时候要做一些额外的处理,比如可读的,一直... Read More
posted @ 2015-11-17 22:45 findumars Views(899) Comments(0) Diggs(0)
This post is a step-by-step guide on how to compile Qt 4.x.x with MSVC 2010.Although we use Qt 4.7.1 as an example (for historical reasons), you can a... Read More
posted @ 2015-11-17 22:13 findumars Views(476) Comments(0) Diggs(0)
看本文时,可以同时参考:Delphi中线程类 TThread实现多线程编程(事件、临界区、Synchronize、WaitFor……)先说一下RTL和VCL RTL(Run-Time library),运行时库,包括System、SysUtils、Math三个单元,提供的函数与语言、编译器、操作系... Read More
posted @ 2015-11-17 18:48 findumars Views(3909) Comments(0) Diggs(1)
上面所给出的第一种解决方案: 线程(Execute)在执行定时循环;然后先让 DestroyAThread设置 Terminated属性,通知线程去结束执行、释放资源;然后在线程结束执行、释放资源之后再去通知DestroyAThread,再由DestroyAThread来显式调用线程的 Free方... Read More
posted @ 2015-11-17 18:42 findumars Views(2200) Comments(0) Diggs(0)