event-loop

GLUT: any way to add a "file readable" hook to the event loop?

I'd like to open a socket and hang a readable event on the GLUT event loop... any ideas on how to do this? Portable standard GLUT code is best, but I'm open to platform-specific hacks as well. Thanks! ...

How would you implement a basic event-loop?

If you have worked with gui toolkits, you know that there is a event-loop/main-loop that should be executed after everything is done, and that will keep the application alive and responsive to different events. For example, for Qt, you would do this in main(): int main() { QApplication app(argc, argv); // init code return a...

How to override wxApp::MainLoop properly (wxWidgets)?

I'm writing a cross-platform application. Is there a way in wxWidgets to define my own event loop? How to do that? I want it look like an ordinary windows PeekMessage DispachMessage loop: for(;;) { while(PeekMessage(...)) // dispatching all pending messages { // traslating, dispatching messages // also do something wit...

How to integrate Boost.Asio main loop in GUI framework like Qt4 or GTK

Hello, Is there any way to integrate Boost.Asio with Qt4 (prefered) or GTK main loop? GTK provides poll(2) like API so technically is should be possible. Qt provides its own networking layer, however I prefer to use existing code written for Boost.Asio. I want to integrate them without using an additional thread. Is there any reference...

Python: socket server framework like Tcl "socket -server"

I'm looking to reimplement some Tcl code that uses the socket -server construct [1]. What's the best option in Python for a small, industrial strength multi-user network-based server that includes event loop processing/integration? [1] http://www.tcl.tk/man/tcl8.4/TclCmd/socket.htm ...

Asynchronous event loop design and issues.

Hello, I'm designing event loop for asynchronous socket IO using epoll/devpoll/kqueue/poll/select (including windows-select). I have two options of performing, IO operation: Non-blocking mode, poll on EAGAIN Set socket to non-blocking mode. Read/Write to socket. If operation succeeds, post completion notification to event loop. If ...

why do you need an event-loop for asynchronous requests (e.g., AJAX long polling)

I understand that it's considered bad design to use a normal, threaded webserver (e.g., Apache) for AJAX long polling…but I don't really understand why. Is it because each longpolling request takes significantly more time than a normal one would (thus tying up the processor)? And if that's the case, do threads really take that much ove...

Creating a QThread event loop in an existing non QT thread

My code is a plugin of a host software which gets limited processing time. Therefore, I create a second thread (via system API) and start QApplication there. That way, the GUI runs smoothly. Now, I would like to run a QThread event loop in the original such that I could use Signal/Slot (Qt::QueuedConnection) to invoke functions that are...

GLib - main event loop in C++

Hello, I need to implement my own main event loop in C++ which will be based on GLib library. I don't know where to begin. I studied some materials about GLib, but it doesn't help me to know, how implement event loop. Could somebody give me some advise about it or give me some source code? I basically need to implement GSource and GSourc...