[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] Multi-Threaded Libevent Server Example



I've developed a multi-threaded, libevent-based socket server example which uses a threaded work queue and a separate event queues (event_base in libevent terminology) for each client connection.  This should provide better CPU utilization on hyperthreading, multi-core or multi-CPU architectures.  The single-threaded nature of libevent is problematic on multi-core architectures, because all but one core goes unused.

Also, in situations where an I/O thread is stalled while waiting for an external operation to complete (database query, socket operation, file operation, etc.), a multi-threaded implementation will out-perform a single-threaded implementation.

I wrote an article which describes the implementation in more detail.  It is found here: <a href=""http://www.roncemer.com/multi-threaded-libevent-server-example">http://www.roncemer.com/multi-threaded-libevent-server-example">

Multi-Threaded Libevent Server Example</a>.


The Sourceforge project page is located here: https://sourceforge.net/projects/libevent-thread/

The project also includes a simple, theaded work queue implementation.

The code is BSD licensed, so it is free for re-use, in whole or in part.
*********************************************************************** To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with unsubscribe libevent-users in the body.