HOME

TheInfoList



OR:

libevent is a
software library In computer science, a library is a collection of non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, pre-written code and subr ...
that provides asynchronous event notification. The libevent
API An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software Interface (computing), interface, offering a service to other pieces of software. A document or standa ...
provides a mechanism to execute a
callback Callback may refer to: * Callback (comedy), a joke which refers to one previously told * Callback (computer programming), executable code that is passed as a parameter to other code * Callback (telecommunications), the telecommunications event tha ...
function when a specific event occurs on a
file descriptor In Unix and Unix-like computer operating systems, a file descriptor (FD, less frequently fildes) is a process-unique identifier (handle) for a file or other input/output resource, such as a pipe or network socket. File descriptors typically have ...
or after a
timeout Time-out, Time Out, or timeout may refer to: Time * Time-out (sport), in various sports, a break in play, called by a team * Television timeout, a break in sporting action so that a commercial break may be taken * Timeout (computing), an enginee ...
has been reached. libevent also supports callbacks triggered by
signals In signal processing, a signal is a function that conveys information about a phenomenon. Any quantity that can vary over space or time can be used as a signal to share messages between observers. The ''IEEE Transactions on Signal Processing'' ...
and regular timeouts. libevent is meant to replace the
event loop In computer science, the event loop is a programming construct or design pattern that waits for and dispatches events or messages in a program. The event loop works by making a request to some internal or external "event provider" (that generally ...
found in event-driven
network servers In computing, a server is a piece of computer hardware or software (computer program) that provides functionality for other programs or devices, called " clients". This architecture is called the client–server model. Servers can provide vario ...
. An application can just call event_dispatch() and then add or remove events dynamically without having to change the event loop. Currently, libevent supports /dev/poll, kqueue(2), POSIX select(2), Windows
IOCP Input/output completion port (IOCP) is an application programming interface, API for performing multiple simultaneous asynchronous input/output operations in Windows NT versions 3.5 and later, AIX and on Solaris (operating system), Solaris 10 and ...
,
poll(2) Poll, polled, or polling may refer to: Figurative head counts * Poll, a formal election ** Election verification exit poll, a survey taken to verify election counts ** Polling, voting to make decisions or determine opinions ** Polling places o ...
, epoll(7) and
Solaris Solaris may refer to: Arts and entertainment Literature, television and film * ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem ** ''Solaris'' (1968 film), directed by Boris Nirenburg ** ''Solaris'' (1972 film), directed by ...
event port Event may refer to: Gatherings of people * Ceremony, an event of ritual significance, performed on a special occasion * Convention (meeting), a gathering of individuals engaged in some common interest * Event management, the organization of e ...
s. It also has experimental support for real-time signals. The exposed event API is uniform over all of the supported platforms. As a result, libevent allows for
portable Portable may refer to: General * Portable building, a manufactured structure that is built off site and moved in upon completion of site and utility work * Portable classroom, a temporary building installed on the grounds of a school to provide a ...
application development and provides "the most
scalable Scalability is the property of a system to handle a growing amount of work by adding resources to the system. In an economic context, a scalable business model implies that a company can increase sales given increased resources. For example, a ...
event notification mechanism available on an operating system". Using callbacks on signals, libevent makes it possible to write "secure" signal handlers as none of the user supplied signal handling code runs in the signal's
context Context may refer to: * Context (language use), the relevant constraints of the communicative situation that influence language use, language variation, and discourse summary Computing * Context (computing), the virtual environment required to su ...
. libevent was created by
Niels Provos Niels Provos is a German-American researcher in security engineering, malware, and cryptography. He received a PhD in computer science from the University of Michigan. From 2003 to 2018, he worked at Google as a Distinguished Engineer on security ...
and is maintained primarily by Azat Khuzhin. It is released under a
BSD license BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the use and distribution of covered software. This is in contrast to copyleft licenses, which have share-alike requirements. The original BSD lic ...
.


Notable applications

Some of the notable applications that take advantage of libevent are: *
Google Chrome Google Chrome is a cross-platform web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS ...
: Google's web browser (Mac and Linux versions) *
Memcached Memcached (pronounced variously ''mem-cash-dee'' or ''mem-cashed'') is a general-purpose distributed memory-caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of t ...
: a high-performance, distributed memory object caching system *
Transmission Transmission may refer to: Medicine, science and technology * Power transmission ** Electric power transmission ** Propulsion transmission, technology allowing controlled application of power *** Automatic transmission *** Manual transmission *** ...
: an open-source BitTorrent client *
ntpd The Network Time Protocol daemon (ntpd) is an operating system program that maintains the system time in synchronization with time servers using the Network Time Protocol (NTP). Description The ntpd program is an operating-system daemon that se ...
: the Network Time Protocol
daemon Daimon or Daemon (Ancient Greek: , "god", "godlike", "power", "fate") originally referred to a lesser deity or guiding spirit such as the daimons of ancient Greek religion and mythology and of later Hellenistic religion and philosophy. The word ...
*
Tor Tor, TOR or ToR may refer to: Places * Tor, Pallars, a village in Spain * Tor, former name of Sloviansk, Ukraine, a city * Mount Tor, Tasmania, Australia, an extinct volcano * Tor Bay, Devon, England * Tor River, Western New Guinea, Indonesia Sc ...
: an anonymous Internet communication system *
tmux tmux is an open-source terminal multiplexer for Unix-like operating systems. It allows multiple terminal sessions to be accessed simultaneously in a single window. It is useful for running more than one command-line program at the same time. I ...
: a terminal multiplexer


Alternatives


libev
*
libuv libuv is a multi-platform C library that provides support for asynchronous I/O based on event loops. It supports epoll(4), kqueue(2), Windows IOCP, and Solaris event ports. It is primarily designed for use in Node.js but it is also used by ...
* FAM
Boost Asio


Major version releases

*libevent 2.1 was released on April 3, 2012. *libevent 2.0 was released on April 17, 2009. *libevent 1.4 was released on November 11, 2007. *libevent 1.3 was released on February 15, 2007. *libevent 1.2 was released on October 15, 2006. *libevent 1.1 was released on May 14, 2005.


References


External links

{{Portal, Free and open-source software
Libevent web page

Libevent github repository

Libevent 2.0 book




C (programming language) libraries Events (computing) Free computer libraries Software using the BSD license