News for hackers. Stuff that matters.
Re:Node-Qt: Build native apps using Node.js + Qt (Windows, M... by arturadib on Monday April 09, 2012 @01:39PM (#3818148)
Some Qt APIs are inherently asynchronous (like QHttp) but the graphics-related ones I'm binding to are not (like QPainter).

So the situation is analogous to the DOM in web browsers. The calls are synchronous and run in the main thread. As the web has taught us though, single-threads and blocking graphics calls can go a long way :)

Re:Node-Qt: Build native apps using Node.js + Qt (Windows, M... by iamleppert on Monday April 09, 2012 @01:46PM (#3818194)
True, but Qt specifically (as well as many OS such as Mac OSX) do not allow running of the GUI in anything but the main thread. This is due to the fact that (from what I've read) graphics drivers are not thread safe.

Just wondering how you got around this...I see you're using processEvents in QApplication.

from http://doc.qt.nokia.com/4.7-snapshot/thread-basics.html:

GUI Thread and Worker Thread As mentioned, each program has one thread when it is started. This thread is called the "main thread" (also known as the "GUI thread" in Qt applications). The Qt GUI must run in this thread. All widgets and several related classes, for example QPixmap, don't work in secondary threads. A secondary thread is commonly referred to as a "worker thread" because it is used to offload processing work from the main thread.

Re:Node-Qt: Build native apps using Node.js + Qt (Windows, M... by icefox on Monday April 09, 2012 @02:48PM (#3818559)
On X11 I actually have a bunch of patches so I wrote for Qt so I could do painting in another thread. It was useful for a project where I was injecting QtWebKit into a game where the main thread was the game and the Qt event loop and all its processing had to exists on a different thread sending a single opengl buffer across when rendered. I got some patches into Qt, but others were rejected for one reason or another (could no reproduce, not supported etc), but nonless it was a very cool project.
Re:Node-Qt: Build native apps using Node.js + Qt (Windows, M... by arturadib on Monday April 09, 2012 @01:58PM (#3818284)
> do not allow running of the GUI in anything but the main thread

That's right. AFAIK everything is running in a single thread.