Questions tagged [event-loop]

Event loop refers to an infinite cycle of actions which is used for processing data based on callbacks and messages.

An event loop watches for I/O and timer state changes. It queues functions while waiting for unavailable resources, then dispatches them when resources are available.

References

1046 questions
5
votes
2 answers

What is an event loop or run loop?

In iPhone development, I have come across these terms named event loop, run loop . Can some one explain explain what they are?
RK-
  • 12,099
  • 23
  • 89
  • 155
5
votes
2 answers

Python 3.5 asyncio execute coroutine on event loop from synchronous code in different thread

I am hoping someone can help me here. I have an object that has the ability to have attributes that return coroutine objects. This works beautifully, however I have a situation where I need to get the results of the coroutine object from synchronous…
5
votes
3 answers

Next tick override functionality does function will be called

I need to override the following code Here the function will be executed in the next tick req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { setTimeout(fn, 5); } : function (fn) { fn(); }; with this, window.require.nextTick =…
07_05_GuyT
  • 2,787
  • 14
  • 43
  • 88
5
votes
1 answer

Extension event loop in Gnome 3.10 vs 3.14

I wrote this accessibility extension: https://extensions.gnome.org/extension/975/keyboard-modifiers-status/ https://github.com/sneetsher/Keyboard-Modifiers-Status Which works as supposed in Gnome Shell v3.14 & v3.16 but not in v3.10. It shows the…
user.dz
  • 962
  • 2
  • 19
  • 39
5
votes
1 answer

Does calling QDialog::exec in a slot block the main event loop?

My Qt application's main window is a normal QMainWindow subclass. In that window I have a few buttons; each has its clicked signal connected its own slot, and each slot creates a different QDialog like so: void onButtonA_clicked() { MyADialog*…
user4520
  • 3,401
  • 1
  • 27
  • 50
5
votes
1 answer

Node.js asynchronous call handling and multi-core scaling

It is known that node.js internally handles asynchronous calls and the programmer never needs to care about what is going on in the backstage. As far as I know, even if everyone says that node.js is only single thread, internally v8/libuv libraries…
ralzaul
  • 4,280
  • 6
  • 32
  • 51
5
votes
3 answers

Asynchronous event loop design and issues

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…
Artyom
  • 31,019
  • 21
  • 127
  • 215
5
votes
1 answer

How to make a proper Event Loop (or whatever it is called)?

I am not a programmer or any of such, I am only someone interested in this stuff. I have been trying to make myself an Xbox 360 Controller Mapper, translating controller key presses into simulated keyboard key presses. Reason is that I sincerely…
Utkan Gezer
  • 3,009
  • 2
  • 16
  • 29
5
votes
3 answers

Wait for an async function to return in Node.js

Supposed, I have a async function in Node.js, basically something such as: var addAsync = function (first, second, callback) { setTimeout(function () { callback(null, first + second); }, 1 * 1000); }; Now of course I can call this function…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
5
votes
1 answer

Dart: Is using a zero duration timer the supported way of deferring work to the event loop

I discovered by experimenting that creating a timer with a duration of 0 allows me to defer work into the event queue. I really like this feature, because it allows avoiding a lot of nasty reentrancy issues. Is this intentional functionality that…
Jim Belton
  • 231
  • 2
  • 8
5
votes
1 answer

Basic Event Loop in Python

Possible Duplicate: Event loop implementation for Python 3? I am trying to implement an event loop in python2.7. I would like to be able to trigger events based on a time event and as a result of another action taking place. I understand I can…
Matt Seymour
  • 8,880
  • 7
  • 60
  • 101
5
votes
2 answers

ZeroMQ Poller vs Tornados EventLoop

Design wise and performance wise which approach is recommended for handling multiple Zeromq sockets and why ? Is it true that Tornado's IOLoop used by ZeroMQ hogs less CPU than the Poller used in a while loop for handling multiple sockets ?
crashekar
  • 283
  • 1
  • 6
  • 15
4
votes
4 answers

A way to make keyboard event queue both responsive and not take whole CPU power

I am making an Sdl game, it's 2d shooter. I am using SDL to import surfaces and OpenGL to draw them on the screen (doing so because it works way faster than just SDL). I've got two threads running, one for processing stuff and rendering, and another…
Sunius
  • 2,789
  • 18
  • 30
4
votes
2 answers

"Unhandled Event Loop Exception" when doing anything in Android XML

I'm getting this "Unhandled Event Loop Exception" error when I do very minimal things with my xml layout in Android (Eclipse 3.6.2). Everything I do makes this error come up. And the dialog box will be something like "Error...35" or something. It's…
Cole
  • 2,805
  • 9
  • 44
  • 61
4
votes
5 answers

Suggestions For Java Event-Loop Libraries

I am looking for something like the JavaScript setTimeout, but with a Runnable, with the following restrictions: Does not require individual dedicated threads per timeout. Already developed and thought through. Maybe even including additional…
700 Software
  • 85,281
  • 83
  • 234
  • 341