Scheduler rewrite over

2 views
Skip to first unread message

Gaspard Bucher

unread,
Sep 20, 2011, 3:04:39 PM9/20/11
to Lubyk mailing-list
Hi everyone !

After nearly two weeks of very hard work, I have completely rewritten the core of Lubyk to use a single thread for all operations. This means that even though a typical process uses:

1. zmq sockets
2. Bonjour registration
3. Bonjour browsing
4. Qt windows and widgets

Only one thread runs for all of this thanks to Lua's great support for coroutines and because all these things offer a filedescriptor based interface (and can therefore live inside a single "select" or "poll" based loop). For those familiar with Lua code, here's the scheduler and thread objects [1], [2].

The main advantages (and motivations) for this change are:

1. improved stability
2. explicit scheduling (makes it easy to add events and/or finalizers like midi note off)
3. no need to check thread context for GUI or OpenGL
4. should require less CPU

Now, a waiting application or process uses 0% cpu which is logical and nice.

As soon as the editor and graphical interface are fixed, I'll post an alpha version for macosx to download.

Cheers,

                                                               Gaspard

[1] lk.Scheduler bit.ly/qpAPgk
[2] lk.Thread bit.ly/pUiI0h
Reply all
Reply to author
Forward
0 new messages