Essentially, the strategy is to create a bunch of widgets with callbacks, then enter a main event loop.
本质上,这个策略是创建带回调的一串窗口小部件,然后进入一个主事件循环。
Multithreading your application improves the responsiveness of your user interface by moving long calculations into separate threads and away from your main event loop.
将长时间的计算从主事件循环线程移到别的线程中,从而提高用户接口的响应速度。
You create the necessary network listening sockets, register the events to be called during execution, and then start the main event loop with the libev handling the rest of the process.
创建所需的网络监听套接字,注册在执行期间要调用的事件,然后启动主事件循环,让libev处理过程的其余部分。
By doing so, the loop in the main scope and logic in the event handler controls the final number of event handler instances.
这样,主范围内的循环和事件处理程序中的逻辑就可以控制事件处理程序的最终数目。
When an event occurs, the object associated with that event emits a signal to inform the main loop that it has occurred.
当事件发生时,与这个事件对应的对象发出信号,通知主循环事件已经发生。
The main function creates a Glib event loop, gets a connection to the session bus, and integrates the D-BUS event handling into the Glib event loop.
main函数创建一个Glib事件循环,获得会话总线的一个连接,并将D -BUS事件处理集成到Glib事件循环之中。
In the infinite loop case above, all threads except main are in a waiting state (on a semaphore, or waiting for some event).
在上述死循环的情况下,所有除主线程之外的线程都处于某种等待状态(等待一个信号量,或等待某个事件)。
In the infinite loop case above, all threads except main are in a waiting state (on a semaphore, or waiting for some event).
在上述死循环的情况下,所有除主线程之外的线程都处于某种等待状态(等待一个信号量,或等待某个事件)。
应用推荐