litev

Timeline
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

50 most recent check-ins

2023-03-28
15:53
Goodbye. Leaf check-in: ba4c8a9a2c user: engler tags: trunk
15:53
Add install and uninstall targets. check-in: 133fceaa85 user: engler tags: trunk
15:53
Version 0.4. check-in: 2d49ff97a5 user: engler tags: trunk
15:53
Fix memory leak in kqueue_close(). Previously, litev leaked memory while using the `kqueue(3)` kernel event notification API. This was because litev did not reduced the amount of active events, when `litev_close()` was used. This commit fixes this bug, by using `kqueue_del()` instead of `hash_del()` for removing the events prior to closing the file descriptor. check-in: a8be4b5a0d user: engler tags: trunk
15:53
Reuse address. check-in: 20c7951c00 user: engler tags: trunk
15:53
Add litev(3) performance test. check-in: 1143891dbd user: engler tags: trunk
15:53
Remove redundant compiler flag in perf/. This commit removes a redundant `-O2` flag for the `libevent` target inside the `perf/Makefile`, as this flag is already defined inside the `CFLAGS` variable of that particular Makefile. check-in: c01ca5599c user: engler tags: trunk
15:53
Move create_socket() into perf_socket(). This commit moves the `create_socket()` function found in `libevent.c` into the performance test library to a function called `perf_socket()`. As this commit also creates the `perf.c` file, it also changes the Makefile and .gitignore file accordingly. check-in: ecf68b71d6 user: engler tags: trunk
15:53
Begin work on a performance tests library. This commit begins the work on the performance test library, which will contain functions that are the same across all performance tests, such as the socket creation. Currently, this library only consists of a single header file called `perf.h`, which contains the default HTTP/1.1 response inside the CPP definition `PERF_REPLY`. Future functionality is going to be added within the next commits. check-in: 27b75be6e6 user: engler tags: trunk
15:53
Add Makefile for the performance tests. This commit adds a simple Makefile for the performance tests found in the `perf/` directory. check-in: 49dd55ef51 user: engler tags: trunk
15:53
Fix memory leak in libevent.c. This commit fixes a memory leak found in the libevent performance test, where it does not free the allocated client event. check-in: d23f8eb92a user: engler tags: trunk
15:53
Add performance test for libevent(3). This commit begins work on the performance test suite by implementing the `libevent(3)` version of it. check-in: 90e415bdf0 user: engler tags: trunk
15:53
Do not block if no events are registered. Previously, the `poll_poll()` function blocked independently, no matter if events were registered or not. This behavior is unacceptable, as it makes the adding and removing of events impossible. This commit introduces a new variable, `nactive_ev`, into the `struct poll_data`, which has a meaningless value, that only matters if it is zero or not. This variable is then being checked by `poll_poll()` during the very beginning and will cause the function to return immediately with `LITEV_OK`, if its value is zero. Now, `poll_poll()` behaves like its `kqueue(2)` and `epoll(2)` pedant: Return immediately if no events are registered. check-in: 248caf2ff0 user: engler tags: trunk
15:53
Do not check the event API data directly in epoll(2). This commit removes the if-clause before the `epoll_wait(2)` call inside `epoll_poll()` and replaces it with a deeper check for the appropriate `errno` values instead. check-in: 00d9520ca8 user: engler tags: trunk
15:53
Version 0.3. check-in: e75e839626 user: engler tags: trunk
15:53
Remove useless includes. This commit removes the `#include <stdio.h>` from `poll.h` due to the fact that those functions are not being used inside the source file. It was probably a relict of debugging. check-in: cb195905a9 user: engler tags: trunk
15:53
Add bare-bones.c. This commit adds the `bare-bones.c` example, which should resemble a typical and minimal litev application. check-in: 9bb4e6415d user: engler tags: trunk
15:53
Fix broken link in README.md. This commit fixes a broken link to the `LICENSE` file in `README.md`, which previously linked to `LICENSE.md`, a non-existing file. check-in: 413a226bfc user: engler tags: trunk
15:53
Convert README to markdown. This commit converts the `README` file to markdown, thereby changing its name to `README.md`. check-in: 01065f2451 user: engler tags: trunk
15:53
Implement epoll_del(). This commit implements the `epoll_del()` function for removing already registered events from the event loop. Because of this, the `epoll(2)` implementation can now be considered complete. check-in: a9e8356f34 user: engler tags: trunk
15:53
Add comment regarding the epoll_grow() function. This commit adds a comment explaining that `epoll_grow()` must be called before `nactive_ev` is being incremented. This issue led to several hours of debugging yesterday and could be avoided with having a comment explaining this. check-in: f68b358948 user: engler tags: trunk
15:53
Specify the ANSI C standard. This commit adds `-std=c99` to the `CFLAGS` inside the Makefile. check-in: b9f9146b49 user: engler tags: trunk
15:53
Rename LITEV_EEXISTS to LITEV_EEXIST. This commit fixes a typo in the error `LITEV_EEXISTS`, which should have been called `LITEV_EEXIST`, in order to resemble the `EEXISTS` errno. check-in: a5e3d12555 user: engler tags: trunk
15:53
Implement most of the epoll(2) backend. This commit implements all of the functions necessary for the `struct litev_ev_api`, for the `epoll(2)` kernel event notification API, except for the deletion functionality, which is going to be added within the next commits. check-in: 68a12617d1 user: engler tags: trunk
15:53
Remove useless includes in the kqueue(2) backend. This commit removes `#include <string.h>` from `kqueue.c`, as functions from this header file are not longer being used inside this source file. check-in: cd8cb2ed21 user: engler tags: trunk
15:53
Implement backend independent hash table. This commit moves the hash table implementation from `kqueue.c` into its own file `hash.c`. It is done because other kernel event notification API backends such as `epoll(2)` will require a hash table as well, so it only makes sense to not reinvent the wheel every time. check-in: 914d098c44 user: engler tags: trunk
15:53
Revert a mistake. check-in: 9026b8af08 user: engler tags: trunk
15:53
Rename the hash map to khash in the kqueue(2) backend. This commit renames the kqueue hash map related things from `hash` to `khash` in order to distinguish from other hash map implementations used by different backends, such as `epoll(2)` in the future. check-in: 04d610a40a user: engler tags: trunk
15:53
Rename index to slot in the kqueue(2) backend. This commit renames all variables with the name `index` to `slot`, for the following two reasons: 1. More consistency with other backends, such as `poll(2)`. 2. Less possible conflicts, due to the fact that there is an ANSI C function called `index()`. check-in: 72fc4a2c7d user: engler tags: trunk
15:53
Begin work on the epoll(2) backend. This commit introduces the kernel event notification API detection inside `config.h` for the `epoll(2)` kernel event notification API, in case that the Linux kernel is being used. Beside this, it also implements the `ev_api_epoll()` function, which however only initializes the `struct litev_ev_api` fields to NULL. Logic is going to be added within the next commits. check-in: 4826896a9e user: engler tags: trunk
15:53
Version 0.2. check-in: 8a2764b184 user: engler tags: trunk
15:53
Fix ambitious comments. The terminology "kernel notification API" is some kind of ambitious. This commit changes all of these occurrences to "kernel event notification API". check-in: b725581b40 user: engler tags: trunk
15:53
Implement the poll(2) backend. This commit implements all of the functions necessary for the `struct litev_ev_api`, for the `poll(2)` kernel event notification API. check-in: b1bad9d338 user: engler tags: trunk
15:53
Fix misleading comment. This commit uses the correct formulation, kernel notification API, for the explanation of `struct litev_ev_api`. check-in: 5f6bcff375 user: engler tags: trunk
15:53
Move kernel notification API detection. This commit moves the detection for the kernel notification API that is going to be used from `litev-internal.h` to its own dedicated file, `config.h`. The reason for this is, that the current build fails on non-BSD systems because they try to include `<sys/event.h>` although it does not exist, because the inclusion of `litev-internal.h` happens later, though it is not aware of constants such as `USE_KQUEUE` during that point of time. With this commit, all source files include `config.h` as their first file, even before `<sys/types.h>`. Directly after this, they ensure that this only builds, if the appropriate kernel notification API is being used, by performing the check such as `#ifdef USE_KQUEUE`. check-in: 40283cd4db user: engler tags: trunk
15:53
Begin work on the poll(2) backend. This commit introduces the kernel event notification API detection inside `litev-internal.h` for the `poll(2)` event notification API, in case that no better alternative was found (due to the fact that `poll(2)` is part of POSIX). Beside this, it also implements the `ev_api_poll()` function, which however only initializes the `struct litev_ev_api` fields to NULL. Logic is going to be added within the next commits. check-in: eb708a9357 user: engler tags: trunk
15:53
Only compile kqueue(2) if USE_KQUEUE is defined Previously, the `kqueue.c` file was always compiled, regardless if the `kqueue(2)` kernel event notification API is being used or not. This commit adds the entire `kqueue.c` code base (except for the preprocessor stuff) into an `#ifdef USE_KQUEUE`, because support for other kernel event notification APIs is going to be added soon. check-in: 164310b22f user: engler tags: trunk
15:53
Use litev_close() in tcp-echo.c. This commit updates the `tcp-echo.c` example in order to use `litev_close()` for removing clients who closed the connection. check-in: b9984c4766 user: engler tags: trunk
15:53
Implement litev_close(). This commit adds and implements a new function to the public API called `litev_close()`, which removes all registered events from the kernel event notification API associated with that file descriptor and performs a `close(2)` on it. Previously, the calling process had to call `litev_del()` before passing it to `close(2)`. The reason why this function is added, although the same goal can be achieved with other ways as well, is because it is a very common operation and might actually result in a performance increase depending on the kernel event notification API that is in use. check-in: 97aa3d899a user: engler tags: trunk
15:53
Version 0.1. check-in: 7ebe76d6ed user: engler tags: trunk
15:53
Add ISC license. This comit puts the `litev` project under the ISC (like OpenBSD) license. check-in: bc64bb7616 user: engler tags: trunk
15:53
Actually set is_dispatched. Previously the `litev_dispatch()` function did not set the `is_dispatched` boolean inside `struct litev_base`. This resulted in `litev_break()` not being able to stop the event loop as it demands that this boolean is set to true in order work. It was spotted while trying to examine the `tcp-echo.c` example. check-in: 145d158125 user: engler tags: trunk
15:53
Add tcp-echo.c. This commit introduces an example of a simple TCP echo server using non-blocking sockets and `litev(3)`. It also serves as a way of debugging and showed a bug inside the implementation of `litev_dispatch()`. check-in: be75645d3f user: engler tags: trunk
15:53
Implement the kqueue(2) backend. This commit implements all of the functions necessary for the `struct litev_ev_api` function pointers. However, this implementation should not be considered complete, as it remains untested yet. check-in: aee54e73f8 user: engler tags: trunk
15:53
Implement a hash map for kqueue. Because our original intention to store the copies of `struct litev_ev` into a doubly linked list turned out to be a bad design decision, we now use a hash map instead. This commit adds the implementation for a simple hash map which identifies the events by the `fd` and the `condition` field. check-in: c4eb33a6af user: engler tags: trunk
15:53
Remove the kqueue(2) backend As mentioned in previously, there is a mistake made during the design decision of picking a doubly linked list for the storage engine. Because of this mistake, many parts of the `kqueue(2)` implementation need to be rewritten, which will be done in the following commits. check-in: 450b9f3201 user: engler tags: trunk
15:53
Document the unstable API. check-in: 7116ec6b54 user: engler tags: trunk
15:53
Make enum litev_err public. This commit moves the `enum litev_err` from `litev-internal.h` to `litev.h`, thereby making it public. check-in: f694fbb97c user: engler tags: trunk
15:53
Remove struct litev_base * from the cb. This commit removes the `struct litev_base *` as an argument from the function prototype of the `struct litev_ev` callback. This is done because it may not always be necessary to have access to the event loop and in the case it is still desired, the caller is free to use `udata` or a global variable for it. check-in: aad49b67bc user: engler tags: trunk
15:53
Implement the kqueue(2) backend. This commit implements all of the functions necessary for the `struct litev_ev_api`. Currently however, there is still a problem with `litev_del()`, which will leak memory up until a call to `udata_free()`. check-in: ea404a64ad user: engler tags: trunk