lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


== New Features == 

* Condition Variables: The new cqueues.condition module implements
  light-weight, user-defined condition variables to help synchronize Lua
  threads. For example, to efficiently sleep and then signal thousands of
  long-polling contexts waiting for new data to send.

  This primitive can also be used to implement mutex, semaphore, and monitor
  patterns.

* Lua 5.3 Support: Added build and install targets for Lua 5.3.

* thread.start: Now allows passing more primitive types such as numbers,
  booleans, and nils. Previously it would stringify every argument to
  be passed to a new thread.

* socket:connect: Added missing connect method, which allows explicitly
  waiting on DNS lookup and TCP connection establishment. This method was
  overlooked previously because an explicit wait-on-connect operation is
  unnecessary from application code.

== About ==

cqueues is a high-performance, coroutine based event loop which wraps epoll,
kqueue, and Solaris ports event descriptors, as well as their cousin
interfaces such as signalfd and inotify.

* Composable: Each event loop is itself pollable, and can be easily tied
  into existing event loop systems in the larger application, whether in
  Lua, C, or some other language. loop:pollfd() returns the underlying
  epoll, kqueue, or ports descriptor, and will signal ready when a child
  coroutine is ready to resume.

  Additionally, the modules maintain no global state in the user process,
  nor will they ever block the process. No callbacks are used, so C code
  within or outside the event loop does not need to worry about reentrancy.

  You can synthesize pollable objects by providing the methods :pollfd,
  :events, and :timeout.

* High-performance: Because the loop controller pins every polled object
  into memory for at least one full scheduling cycle, descriptor management
  is optimal, without recourse to one-shot polling or complex reference
  counting.

* No Dependencies: The only dependencies needed are already installed on
  your server--pthreads, OpenSSL, and of course Lua!

* Comprehensive: The package provides modules for sockets, signals, native
  file change notification, POSIX thread management, DNS resolution, and
  light-weight Lua thread synchronization.

  + cqueues.socket: Full-, line-, and non-buffering sockets with CRLF/LF
    translation, automagic DNS resolution, SSL/TLS capabilities, and Unix
    file descriptor passing.

  + cqueues.signal: Employs Linux signalfd and BSD EVFILT_SIGNAL.
    On Solaris synthesizes non-blocking signal polling with sigtimedwait.

  + cqueues.notify: Employs Linux inotify, BSD EVFILT_VNODE, and Solaris
    PORT_SOURCE_FILE for efficient file change notifications.

  + cqueues.thread: Simple POSIX thread management, with pollable
    thread handles and automatic socket channel creation for easy
    inter-thread communication. As the sockets module supports descriptor
    passing, it's trivial to transfer open files or sockets between POSIX
    threads.

  + cqueues.dns: Full DNS resolver (stub and recursive) with ability
    to configure itself from common /etc configuration files on BSD and SysV
    systems.

  + cqueues.condition: Light-weight, user-defined condition variables
    for efficient synchronization of Lua threads.

* Maintained: cqueues is used to power multiple commercial services and
  products with significant traffic. Bugs are fixed quickly, and new
  features added on a steady basis. This and the non-open source predecessor
  project have been in continuous use and development for nearly 4 years.

== Links ==

Homepage: http://25thandclement.com/~william/projects/cqueues.html

Tarball: http://25thandclement.com/~william/projects/releases/cqueues-20140322.tgz

GitHub: https://github.com/wahern/cqueues

Documentation: http://25thandclement.com/~william/projects/cqueues.pdf