Thursday, May 30, 2013

Multithreading in FLTK

The very smart way: http://www.fltk.org/doc-1.3/advanced.html
int main() {
      Fl::lock();
      /* run thread */
      while (Fl::wait() > 0) {
        if (Fl::thread_message()) {
          /* process your data */
        }
      }
    }

//////////////
void *msg;       // "msg" is a pointer to your message
Fl::awake(msg);  // send "msg" to main thread

//////////////

void do_something(void *userdata) {
      // running with the main thread
    }

    // running in another thread
    void *data;       // "data" is a pointer to your user data
    Fl::awake(do_something, data);  // call something in main thread

Thursday, May 2, 2013

Smart GUI layout

MiG layout is fun. (java) http://www.miglayout.com/QuickStart.pdf

Tuesday, April 30, 2013

Linux low-level GUI graphics

X11: xlib for window and events, XCB for low-level asynchronous, XRender extension for modern 2D graphics, Xft library for fonts rendering. More to read: http://blog.mecheye.net/2012/06/the-linux-graphics-stack/

Monday, March 18, 2013

lock-free library in c

http://www.concurrencykit.org/

Wednesday, October 3, 2012

Lock-free queue benchmark

My Lock and lock-free queue benchmark in Java: https://github.com/exhu/miscalg/tree/master/lockfreej Possibly contains ABA problem, but did not show itself while tests -)

Tuesday, October 2, 2012

online compiler/disasm

http://gcc.godbolt.org/