Skip to content

The Combined Event Loop

bmeck edited this page Sep 8, 2010 · 10 revisions

The Situation:

sf::Window only queues events with sf::Window::GetEvent, this means events will stack up while waiting.

The Problem:

By Node.js conventions, we should emit these events to listeners. However, we cannot do this easily from C++ without some concerns.

The Solutions:

  1. Add events async to the event loop using v8's locker mechanism using a separate thread.
    • Locks can take a while to get to
  1. At the end of any event loop, check for events in our sf::Window pool.
    • Can slow down the whole node.js event loop.
Clone this wiki locally